Skip to main content
Glama

send_message

Send messages to A2A agents and receive immediate status or pending task IDs for background result retrieval.

Instructions

Sends a message to an agent and returns the task status.

This function initiates a task with an agent. It will return quickly.

  • If the agent responds within 5 seconds, the final result is returned.

  • Otherwise, a 'pending' status is returned, and the gateway continues to fetch the result in the background. Use the 'get_task_result' tool with the returned 'task_id' to check for completion.

Args: agent_url (str): The URL of the registered A2A agent. message (str): The text message to send. session_id (Optional[str]): An optional identifier for conversation context. ctx (Context): The MCP context for logging.

Returns: Dict[str, Any]: A dictionary representing the task. It will contain the final result if completed quickly, or a pending status if the agent takes longer to respond.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_urlYes
messageYes
session_idNo
Behavior4/5

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

With no annotations provided, the description carries the full burden and does so well. It discloses key behavioral traits: the function returns quickly, details timing conditions (5-second threshold for immediate vs. pending results), and explains background fetching and the need to use 'get_task_result' for completion checks. It doesn't cover aspects like error handling or rate limits, but provides substantial operational context.

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 well-structured and appropriately sized, with a clear opening sentence stating the purpose, followed by bullet points for behavioral details and structured sections for Args and Returns. Every sentence adds value without redundancy, making it easy to scan and understand quickly.

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

Completeness4/5

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

Given the complexity of initiating tasks with agents, no annotations, and no output schema, the description is largely complete. It covers purpose, usage, parameters, and return behavior comprehensively. However, it lacks details on error cases or authentication needs, which could be relevant for a tool interacting with external agents.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, which it does effectively. It adds meaning beyond the schema by explaining each parameter: 'agent_url' as the URL of a registered A2A agent, 'message' as the text to send, and 'session_id' as an optional identifier for conversation context. This clarifies the purpose and usage of all parameters, though it doesn't detail format constraints.

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

Purpose5/5

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

The description clearly states the specific action ('sends a message to an agent') and the outcome ('returns the task status'), distinguishing it from sibling tools like 'get_task_result' or 'list_agents'. It explicitly mentions initiating a task with an agent, which clarifies the operational context beyond just sending a message.

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

Usage Guidelines4/5

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

The description provides clear context on when to use this tool: to send a message to an agent and initiate a task. It explicitly mentions using 'get_task_result' as an alternative for checking completion if a 'pending' status is returned, which helps differentiate from siblings. However, it doesn't specify when NOT to use it or compare with other tools like 'register_agent'.

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/yw0nam/mcp_a2a_gateway'

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