Skip to main content
Glama
tesla0225

A2A Client MCP Server

by tesla0225

a2a_send_task

Send messages to A2A protocol agents for task execution, with optional task and agent ID assignment for tracking and routing.

Instructions

Send a task to an A2A agent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesMessage to send to the agent
taskIdNoOptional task ID. If not provided, a new UUID will be generated
agentIdNoOptional agent ID. If not provided, the first available agent will be used

Implementation Reference

  • The handler function for the 'a2a_send_task' tool. It extracts parameters, selects an agent client, sends the task using client.sendTask, and returns the result as a formatted text response.
    case "a2a_send_task": {
      const { message, taskId, agentId } = args as { message: string; taskId?: string; agentId?: string };
      const client = agentId ? agentManager.getClientById(agentId) : agentManager.getAllClients().values().next().value;
      
      if (!client) {
        throw new Error(`No available agent${agentId ? ` with ID ${agentId}` : ''}`);
      }
    
      const result = await client.sendTask({
        id: taskId || crypto.randomUUID(),
        message: {
          role: "user",
          parts: [{ text: message }],
        },
      });
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • The input schema definition for the 'a2a_send_task' tool, specifying the required 'message' and optional 'taskId' and 'agentId' parameters.
    {
      name: "a2a_send_task",
      description: "Send a task to an A2A agent",
      inputSchema: {
        type: "object",
        properties: {
          message: {
            type: "string",
            description: "Message to send to the agent",
          },
          taskId: {
            type: "string",
            description: "Optional task ID. If not provided, a new UUID will be generated",
          },
          agentId: {
            type: "string",
            description: "Optional agent ID. If not provided, the first available agent will be used",
          },
        },
        required: ["message"],
      },
    },
  • index.ts:31-131 (registration)
    Registration of available tools including 'a2a_send_task' via the ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: "a2a_send_task",
          description: "Send a task to an A2A agent",
          inputSchema: {
            type: "object",
            properties: {
              message: {
                type: "string",
                description: "Message to send to the agent",
              },
              taskId: {
                type: "string",
                description: "Optional task ID. If not provided, a new UUID will be generated",
              },
              agentId: {
                type: "string",
                description: "Optional agent ID. If not provided, the first available agent will be used",
              },
            },
            required: ["message"],
          },
        },
        {
          name: "a2a_get_task",
          description: "Get the current state of a task",
          inputSchema: {
            type: "object",
            properties: {
              taskId: {
                type: "string",
                description: "ID of the task to retrieve",
              },
              agentId: {
                type: "string",
                description: "ID of the agent that handled the task",
              },
            },
            required: ["taskId", "agentId"],
          },
        },
        {
          name: "a2a_cancel_task",
          description: "Cancel a running task",
          inputSchema: {
            type: "object",
            properties: {
              taskId: {
                type: "string",
                description: "ID of the task to cancel",
              },
              agentId: {
                type: "string",
                description: "ID of the agent that is handling the task",
              },
            },
            required: ["taskId", "agentId"],
          },
        },
        {
          name: "a2a_send_task_subscribe",
          description: "Send a task and subscribe to updates (streaming)",
          inputSchema: {
            type: "object",
            properties: {
              message: {
                type: "string",
                description: "Message to send to the agent",
              },
              taskId: {
                type: "string",
                description: "Optional task ID. If not provided, a new UUID will be generated",
              },
              agentId: {
                type: "string",
                description: "Optional agent ID. If not provided, the first available agent will be used",
              },
              maxUpdates: {
                type: "number",
                description: "Maximum number of updates to receive (default: 10)",
              },
            },
            required: ["message"],
          },
        },
        {
          name: "a2a_agent_info",
          description: "Get information about the connected A2A agents",
          inputSchema: {
            type: "object",
            properties: {
              agentId: {
                type: "string",
                description: "Optional agent ID. If not provided, information for all agents will be returned",
              },
            },
          },
        },
      ],
    }));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Send a task') but does not explain what happens after sending—e.g., whether it's asynchronous, if it returns a response, or any error conditions. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core action without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of sending tasks in an A2A system, no annotations, and no output schema, the description is insufficient. It fails to address key aspects like response format, error handling, or interaction with sibling tools, leaving the agent with incomplete context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the schema already documents all parameters (message, taskId, agentId) with details like optionality and defaults. The description adds no additional semantic meaning beyond what the schema provides, resulting in a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Send') and the resource ('a task to an A2A agent'), making the purpose understandable. However, it does not differentiate this tool from its sibling 'a2a_send_task_subscribe', which likely has a similar purpose but with subscription functionality, leaving room for improvement in specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'a2a_send_task_subscribe' or other siblings. The description lacks context on prerequisites, such as agent availability or task management scenarios, offering minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tesla0225/mcp-a2a'

If you have feedback or need assistance with the MCP directory API, please join our Discord server