Skip to content

Agent Mesh

node: tell agents to propose installing the a2a CLI

Tomas Tormo43e58772ff85
diff --git a/internal/node/mcp.go b/internal/node/mcp.go
index 6d2ca9ad..494935a9 100644
--- a/internal/node/mcp.go
+++ b/internal/node/mcp.go
@@ -52,7 +52,7 @@ Tools on remote services are identified via the format 'scheme://service-name/to
Inference services ('inference://...') are NOT called via call_remote_tool — they are plain OpenAI-compatible HTTP endpoints. Use discover_remote_services with type 'inference' to get each one's local_proxy_url, then send a normal HTTP request (e.g. POST <local_proxy_url>/chat/completions) directly to that URL.
-A2A agents ('a2a://...') are NOT called via call_remote_tool either: discover them with type 'a2a', then point a stock A2A client, e.g. the official a2a CLI (github.com/a2aproject/a2a-cli), at <local_proxy_url>/.well-known/agent-card.json over TCP with the same 'X-Sam-Authentication' header (for that CLI: A2ACLI_SVC_PARAM="X-Sam-Authentication=Bearer <token>").
+A2A agents ('a2a://...') are NOT called via call_remote_tool either: discover them with type 'a2a', then point a stock A2A client, e.g. the official a2a CLI (github.com/a2aproject/a2a-cli), at <local_proxy_url>/.well-known/agent-card.json over TCP with the same 'X-Sam-Authentication' header (for that CLI: A2ACLI_SVC_PARAM="X-Sam-Authentication=Bearer <token>"). Check for the CLI with 'a2a version'. If it is missing, propose installing it to the user before trying anything else, and do not hand-write A2A JSON-RPC requests: method names differ between A2A versions, so guessed calls fail.
To authenticate such an HTTP request to this node, try these in order:
1. If get_mesh_info reports a local_api_socket, send the request over that Unix socket and skip authentication entirely: it serves this same HTTP API, and only the user who owns the socket can connect to it, so no token is involved and no secret lands in a command line. e.g. 'curl --unix-socket <local_api_socket> <local_proxy_url>/chat/completions'.