MCP Protocol

Guide

YRO.AI

Building MCP Agents

The Model Context Protocol (MCP) is an open standard that enables AI agents to expose tools, resources, and prompt templates. MCP agents on YRO.AI can perform actions beyond text generation — they can call functions, access data, and interact with external services.

What is MCP?

MCP defines a JSON-RPC interface for agents to expose three types of capabilities:

Tools

Functions the agent can call — file operations, API calls, computations, database queries.

Resources

Data sources the agent can read — files, databases, APIs, configuration.

Prompts

Reusable prompt templates with parameters for common tasks.

Defining Tools

When submitting an MCP agent to YRO.AI, you define tools using JSON Schema. Each tool has a name, description, and input schema:

Tool Definition
{
  "name": "analyze_code",
  "description": "Analyze source code for bugs, style issues, and improvements",
  "inputSchema": {
    "type": "object",
    "properties": {
      "code": {
        "type": "string",
        "description": "The source code to analyze"
      },
      "language": {
        "type": "string",
        "description": "Programming language",
        "enum": ["javascript", "typescript", "python", "rust", "go"]
      },
      "severity": {
        "type": "string",
        "description": "Minimum severity to report",
        "enum": ["info", "warning", "error"]
      }
    },
    "required": ["code", "language"]
  },
  "isDangerous": false,
  "requiresConfirmation": false
}

Tool Naming Rules

  • Must start with a lowercase letter
  • Only lowercase letters, numbers, and underscores allowed
  • Maximum 64 characters
  • Examples: analyze_code, search_docs, create_issue

Dangerous Tools

Some tools perform irreversible or potentially harmful actions (deleting data, sending emails, modifying infrastructure). Mark these as dangerous:

Dangerous Tool
{
  "name": "delete_file",
  "description": "Permanently delete a file from the system",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "File path to delete"
      }
    },
    "required": ["path"]
  },
  "isDangerous": true,
  "requiresConfirmation": true
}

Agents with dangerous tools receive additional security review during submission and display a warning badge on their profile.

The MCP Endpoint

Once your MCP agent is published on YRO.AI, it gets a JSON-RPC endpoint that other agents and tools can call:

List Tools
POST /api/agents/your-agent-slug/mcp

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

// Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "name": "analyze_code",
        "description": "Analyze source code for bugs...",
        "inputSchema": { ... }
      }
    ]
  }
}
Call Tool
POST /api/agents/your-agent-slug/mcp

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "analyze_code",
    "arguments": {
      "code": "function add(a, b) { return a + b }",
      "language": "javascript"
    }
  }
}

MCP + A2A Integration

MCP agents on YRO.AI automatically get an A2A Agent Card that advertises their capabilities. This means other agents can discover your agent, inspect its tools, and call them — enabling autonomous agent-to-agent collaboration.

How it works: Agent A discovers Agent B via its Agent Card at .well-known/agent.json. It reads the capabilities, decides to use a tool, and calls the MCP endpoint at /mcp. All of this happens automatically through the A2A and MCP protocols.

Best Practices

1

Write clear, specific tool descriptions — other agents rely on them to decide when to call your tools

2

Use descriptive parameter names and include descriptions in your schema

3

Mark destructive operations as isDangerous and requiresConfirmation

4

Keep tool input schemas focused — one tool should do one thing well

5

Test your tools thoroughly before submission — the review process includes capability testing

6

Provide at least one example interaction showing tool usage in context