Skip to main content

What is the MCP Builder?

The MCP Builder allows you to create custom code tools that extend your agent’s capabilities. Using the Model Context Protocol (MCP), you can define Python functions with specific input schemas that your agents can call during execution.
MCP (Model Context Protocol) is a standardized way to provide tools and context to AI agents. Narada’s MCP Builder makes it easy to create, manage, and share custom tools without writing boilerplate code.

How It Works

With the MCP Builder, you can create custom Python functions with defined input schemas that perform specific tasks—from API calls to data processing to complex computations. Add multiple tools to a single MCP server, each with its own name, description, and input schema. Once configured, copy the MCP URL and paste it into any agent step in the Agent Builder to give your agent access to all tools in that server.

Create Tools

Build Python functions with custom logic and input schemas

Use MCP URL

Copy the server URL to use across multiple agent workflows

Extend Agents

Agents automatically gain access to all tools in the MCP server

Creating a Code Tool

MCP Builder edit tool interface showing tool configuration
Each code tool consists of four main components:
A clear, descriptive name for your tool (e.g., getWeather, sendEmail, calculateROI). This is how the agent will reference the tool.
Explain what the tool does and when to use it. The agent uses this description to determine when to call your tool, so be specific and clear.
Write descriptions from the agent’s perspective. Instead of “This tool gets weather”, write “Use this tool to retrieve current weather conditions for a specific location.”
The actual function implementation. Your code should:
  • Accept parameters defined in the Input Schema
  • Return a string result that the agent can understand
  • Handle errors gracefully
async def main(args: InputSchema) -> str:
    # Your Python code here
    return f"Result: {args.field_name}"
Define the parameters your tool accepts using Pydantic models. This ensures type safety and provides clear documentation for the agent.
class InputSchema(BaseModel):
    name: str = Field(description="The name of the person")
    age: int = Field(description="The person's age")

Example: Building a Weather Tool

Here’s a complete example of creating a weather lookup tool:
async def main(args: InputSchema) -> str:
    import requests
    
    # Call weather API
    response = requests.get(
        f"https://api.weather.com/v1/current",
        params={"location": args.location}
    )
    
    data = response.json()
    return f"Weather in {args.location}: {data['temp']}°F, {data['conditions']}"
Tool Name: getWeather Description: Use this tool to retrieve current weather conditions for any location. Provide a city name or ZIP code.

Using MCP Tools in Agent Builder

Once you’ve created your MCP server with custom tools:
1

Copy the MCP URL

Click the Copy URL button in the top-right corner of the MCP Builder.
The URL will be copied to your clipboard automatically.
2

Open Agent Builder

Navigate to the Agent Builder and create or edit an agent workflow.
3

Add MCP to an Agent Step

In any Agent step, find the MCP servers section and paste your MCP URL.
4

Run your agent

The agent now has access to all tools in your MCP server during this step’s execution.
You can add multiple MCP servers to a single agent step, giving your agent access to a wide range of custom capabilities.

Best Practices

Clear Descriptions

Write tool descriptions that clearly explain when and how to use each tool. The agent relies on these descriptions to make decisions.

Type Safety

Always define comprehensive input schemas with field descriptions. This prevents errors and improves agent reliability.

Error Handling

Include try-catch blocks in your code to handle failures gracefully and return meaningful error messages.

Modular Tools

Create focused tools that do one thing well, rather than large multi-purpose functions. This makes them easier to maintain and reuse.

Common Use Cases

  • API Integrations
  • Data Processing
  • Custom Business Logic
Create tools that call external APIs to fetch data, send notifications, or trigger actions in third-party services.
async def main(args: InputSchema) -> str:
    response = requests.post(
        "https://api.service.com/endpoint",
        json={"data": args.data},
        headers={"Authorization": f"Bearer {args.api_key}"}
    )
    return response.json()["result"]

Next Steps

I