Tools & MCP

How to Set Up HTTP Function & MCP

In your MagicBlocks workspace, go to Library > Under Tools > Tools & MCP section where you can create new functions for your AI agent.



HTTP Functions

HTTP Functions are powerful tools that enable your AI to perform specific tasks. These tasks can range from processing user information, making decisions, switching between different conversational tasks, or even retrieving data through API calls. Functions are often linked to various elements of your AI, such as messages, forms, director conditions, and prompts, allowing for highly interactive and dynamic user experiences.

Step-by-Step: Configuring Function Settings

1. General Settings

Name of Function: Provide a clear and descriptive name for the function. This name will help you identify the function’s purpose within the AI Agent.

AI Instruction: Enter specific instructions that the AI should follow when using this function. This helps the AI understand the function's role in the conversation.

Tags: Add tags to categorize the function, making it easier to find in the future.

2. API URL (if applicable)

Enter API URL: If the function needs to communicate with an external service, enter the API endpoint URL here.

HTTP Method: Choose the HTTP method (e.g., POST, GET) based on the requirement of the API.

Headers: Add any necessary headers. For instance, if the API requires authentication, include a header key like Authorization and add the token as the header value.

Security Note: Once saved, header values will be encrypted for security.

3. Function Parameters

Parameter Name: Specify each parameter that the function will need. This could include details the AI will need to pass to the API or process internally.

Parameter Type: Define the type of data (e.g., string, number, boolean) the parameter will accept.

Option Values (optional): If applicable, provide predefined options for the parameter. This is useful when parameters have fixed possible values.

AI Instructions for Parameters: Give the AI clear instructions on how to use each parameter in context.

Example: Using Functions to Guide Conversations

Let’s say you’re creating a function for a Lead Qualification Bot to qualify potential customers. You can create a function that:

Checks if a user meets specific criteria (like their location or interest in a particular product).

Calls an API to fetch more detailed data about the user if necessary.

Determines the next best step based on the user's responses (like scheduling a call or sending them an informational brochure).

Sample Function Setup

Function Name: Qualify_Lead

AI Instruction: “Verify if the user meets lead qualification criteria, then retrieve additional user data if required.”

API URL: https://api.yourcrm.com/qualify

Headers:

Authorization: Bearer YOUR_API_KEY

Function Parameters:

User Location (String): Determine if the user is in a target region.

Interest Level (Number): Rate the user’s interest on a scale of 1-5.

By creating and using functions, you’ll add a layer of depth and interactivity to your AI, enabling it to perform complex tasks and offer tailored responses based on user interactions.

Functions act as a bridge between different parts of the AI Agent, allowing for dynamic adjustments and more precise user engagement.

MCP Server – Agent Capability Infrastructure

Build and stabilize the MCP Server infrastructure to allow MagicBlocks Agents to dynamically discover and execute external tools via MCP, without hard-coded logic.

Goal / Problem Statement

Currently, Agents are limited by statically defined HTTP Functions.
The MCP Server introduces a capability layer that decouples Agent reasoning from tool execution, enabling scalable, extensible, and enterprise-ready integrations.

MCP Server Feature

1. MCP Server Configuration

  • Allow users to create and manage MCP Servers in Tools & MCP
  • MCP Server represents an external capability provider
  • Server name, description, tags
  • Transport type selection
  • Connection configuration
  • Enable/disable MCP Server

2. Transport Types

  • HTTP

3. MCP Connection (HTTP)

4. Discover Tools

  • Dynamically fetch available tools from the MCP Server
  • Establish the MCP handshake and capability discovery
  • Fetch tool metadata (name, schema)
  • Validate MCP protocol compatibility
  • Cache discovered tools for Agent usage

 5. Agent Brain Integration

User sends inbound message → Agent call → MCP Server → use Tools → MCP Server → Agent reply → User

  • Allow Agents (Global/Blocks) to select one or more MCP Servers
  • An agent can use discovered tools during reasoning

Business Impact 🚀

  • Enables enterprise-grade integrations
  • Unlocks future tool marketplace
  • Supports agency & customer-owned infrastructure
  • Foundation for scalable Agent capabilities

A Sample Business Case: AI Loan Pre-Qualification Assistant

Demo MCP Server link: https://remote-mcp-server-authless.jay-0ba.workers.dev/sse

This demonstrates how MagicBlocks integrates with external business systems via MCP.

Problem

Mortgage agencies need to quickly assess borrower eligibility before passing leads to loan officers.

Solution

MagicBlocks Agent integrates with an external MCP Server to perform real-time financial calculations during live conversations.

How it Works

  • User provides income and loan amount
  • The agent calls the external MCP tool
  • MCP returns a structured calculation
  • Agent responds with eligibility result

Business Impact

  • Faster lead qualification
  • Consistent financial logic
  • External business system integration
  • Scalable architecture

Where to Find

Library > Tools > Tools & MCP

How MCP Works in a Real Business Scenario (Example: Beeline)

This demonstrates how a real business system (e.g., Beeline CRM) connects to MagicBlocks via MCP to execute controlled business operations.

Business Context

Beeline operates:

  • A CRM system
  • Lead database
  • Loan application workflow
  • Internal status tracking
  • Sales team assignment logic

They want MagicBlocks Agent AI to:

  • Capture inbound conversations
  • Qualify user intent
  • Push structured data into their CRM
  • Trigger internal workflows
  • Retrieve real-time application status

Without exposing their core backend directly.

Architecture

Beeline deploys its own MCP Server. That MCP Server:

  • Sits between MagicBlocks and Beeline’s internal systems
  • Exposes approved business tools only
  • Controls authentication & permissions
  • Logs every execution for audit

MagicBlocks connects to Beeline’s MCP endpoint under Tools & MCP.

What MCP Enables in a Real Business

Example flows:

Case 1 – Create Lead from Conversation

  1. User shares:
    • Name
    • Phone
    • Loan interest
  1. Agent:
    • Detects lead intent
    • Calls MCP tool: create_lead
  1. MCP:
    • Creates a record in Beeline CRM
    • Returns lead ID
  1. Agent: Confirms submission to the user
  2. Business Result:
    • Lead instantly appears in CRM
    • Sales team notified
    • No manual data entry

Case 2 – Check Application Status

User asks: What’s the status of my loan?

Agent: Calls the MCP tool

    • `Queries the Beeline internal system
    • Returns current status

Agent: Replies with accurate, real-time update. Business Result

    • Reduced support workload
    • Consistent data source
    • No hallucinated answers

Case 3 – Assign Lead to Team

  1. Agent identifies:
    • High-intent customer
    • Meets qualification criteria
  1. Agent: Calls the MCP tool:
    • Assigns the lead inside CRM
    • Triggers internal workflow
  1. Business Result:
    • AI triggers operational workflow
    • Fully automated pipeline movement

Why MCP Matters for Enterprises?

MCP allows:

  1. Controlled execution of business actions
  2. Secure integration without exposing core APIs
  3. Full auditability
  4. Separation between AI layer and core system
  5. Enterprise-grade governance
  6. MagicBlocks does



Was this article helpful?