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.
RemoteAgent
What it is
RemoteAgent is the SDK’s client for any A2A-compliant agent — another Svantic agent in your tenant, a public agent on the internet, or an agent you’re running locally during development. It discovers the remote’s agent card, wraps the A2A JSON-RPC transport, and exposes three ways to interact:
- Structured invocation — call a named capability with typed arguments (
invoke_capability). - Natural-language prompts — send plain text to a smart agent (
send). - Streaming — receive incremental A2A events as the remote produces them (
send_stream,send_stream_message).
RemoteAgent does not require the caller to be an Agent. You can use it from any Node.js process.
When to use it
Reach forRemoteAgent whenever you need to call another agent:
- From a standalone script or service that isn’t itself an agent.
- From inside a capability handler to delegate work to a specialist agent.
- From a smart agent’s orchestration code when the platform’s own routing isn’t enough.
AgentDiscovery — it skips the full client setup.
Functional usage
MessageBuilder + send_stream_message when you need to attach files, session context, or other metadata on the way out.
See Calling other agents for the common patterns.
Connecting
RemoteAgent.connect(url, token?)
/.well-known/agent-card.json, validates it, and returns a ready-to-use RemoteAgent. Pass an optional bearer token when the remote requires authentication.
Throws if the card cannot be fetched or is malformed.
Sending messages
send(message, context_id?)
Message or Task.
Use context_id to continue an existing A2A conversation.
send_stream(message, context_id?)
send, but yields streaming A2A events (Message, Task, TaskStatusUpdateEvent, TaskArtifactUpdateEvent) as the remote produces them.
send_stream_message(message)
Message — use this when you need DataParts, FileParts, or custom metadata alongside text. Construct message with MessageBuilder.
Invoking capabilities
invoke_capability(capability, args, session_context?, context_id?, dispatch_auth?)
capability— capability name as it appears on the agent card.args— arguments matching the capability’s JSON Schema.session_context(optional) —{ session_id, tenant_id }forwarded to the remote handler.context_id(optional) — A2A conversation id.dispatch_auth(optional) — dispatch-auth envelope when the remote requires it.
Inspecting the remote
| Property | Type | Description |
|---|---|---|
agent_card | AgentCard | The full agent card fetched at connect time. |
skills | ExtendedAgentSkill[] | Registered capabilities with parameter schemas. |
name | string | Remote agent name. |
url | string | Base URL passed to connect(). |
client | Client | Underlying @a2a-js/sdk client — for advanced / escape-hatch use. |
See also
- Calling other agents
MessageBuilder— for constructing rich messages.AgentDiscovery— inspect agent cards without connecting.
