Documentation Index
Fetch the complete documentation index at: https://docs.svantic.com/llms.txt
Use this file to discover all available pages before exploring further.
Connecting Agents
Your agent does not work alone. This guide covers how to discover other agents, call their capabilities, and integrate MCP tool servers so your runtime can reach peers and external tools through one mental model.Discovering Agents
AgentDiscovery fetches and caches A2A agent cards from each peer’s /.well-known/agent-card.json endpoint. Use it to inspect names, skills, and metadata before you open a live connection.
- Cards are cached for 60 seconds by default. Pass a different TTL in milliseconds (for example
new AgentDiscovery(30_000)for 30s), or0to disable caching. - Batch:
discover_all([url1, url2])resolves many agents in parallel; failed URLs are skipped and only successful cards are returned. - Force refresh:
discover(url, true)bypasses the cache for that URL once. - Manual invalidation:
invalidate(url)orinvalidate_all()when you know a peer redeployed.
RemoteAgent.connect() always fetches a fresh agent card for the connection itself; discovery caching is only for your own lookups.
Calling Remote Agents
RemoteAgent sends tasks to any A2A agent: natural-language messages, streaming responses, or structured capability calls.
- Auth:
RemoteAgent.connect(url, jwt)addsAuthorization: Bearer <jwt>on requests when the peer requires it. - Streaming:
for await (const event of billing.send_stream('...')) { ... }yields A2A stream events (messages, tasks, status and artifact updates). - Session forwarding: pass
{ session_id, tenant_id }as the third argument toinvoke_capabilitywhen the remote agent should run in an existing session context. - Advanced:
send_stream_messageaccepts a full A2AMessage(seeMessageBuilder).
RemoteAgent calls via W3C traceparent when telemetry is enabled (see Telemetry & tracing).
MCP Integration
Register MCP tool servers as agent capabilities so the mesh and other agents can invoke them like any other skill. The SDK spawns the server as a child process, runs the MCP handshake, and maps each tool to a capability.- Call
register_mcpbeforeexpose()orstart()so discovered tools appear on the agent card. - Each MCP tool becomes a capability named
{prefix}_{tool_name}. By default,prefixis the server name with hyphens replaced by underscores (for examplechrome-devtools→chrome_devtools_navigate). - Custom prefix: third argument
{ tool_prefix: 'browser' }→browser_<tool>. - Environment:
{ command: '...', args: [...], env: { API_KEY: '...' } }is merged withprocess.envfor the child. - Cleanup:
agent.close()oragent.stop()tears down MCP child processes.
define_capability), see MCP integration.
