Skip to main content

A2A (Agent-to-Agent)

Connect your Squid AI agents to external agents that speak the Agent-to-Agent (A2A) protocol​

Overview​

The Agent-to-Agent (A2A) protocol is an open standard that lets AI agents from different platforms talk to each other. With the A2A connector, a Squid AI agent can delegate work to an external A2A-compatible agent: your agent decides when to consult the remote agent, sends it a question, and incorporates the response into its answer.

How it works:

  1. You point the connector at the remote agent's agent card URL. The agent card describes the remote agent's skills. Squid tries the configured URL as-is, then appends /.well-known/agent-card.json and the legacy /.well-known/agent.json to it.
  2. When your Squid agent decides the remote agent can help, it calls the remote agent's ask tool with a prompt. When the agent card advertises streaming, Squid uses message/stream (SSE); otherwise it sends message/send and polls tasks/get, bounded by the chat's timeoutMs.
  3. A remote agent that answers with a task is followed to a terminal state (completed, failed, canceled, rejected) or a paused one (input-required, auth-required). The tool result carries { response, state, taskId, contextId, files }, with the IDs reported for reference.
  4. Text, data, and file parts of the remote answer are all rendered: data parts as JSON, file parts as references listed in the files array.
  5. The remote agent's description and skills from the agent card guide your agent on when to delegate to it.

Long-running remote tasks are durable: Squid stores each one per conversation, so when the agent asks again on a later turn of the same conversation, the stored task is resumed automatically with tasks/resubscribe (falling back to tasks/get). An aborted call leaves the task running remotely; tasks/cancel is sent only by cleanup, once a stored task passes its 24-hour deadline. Remote agents that support push notifications can call back at POST /a2a/notifications/<subscriptionId> instead of being polled.

Adding the A2A connector to your Squid application​

  1. Navigate to the Connectors tab in the Squid Console.

  2. Click Available Connectors.

  3. Find the A2A connector, and select Add Connector.

  4. Provide the following configuration details:

Connector ID: A string that uniquely identifies the connector in your code.

A2A Agent Card URL: The URL of the remote agent's agent card. For example, https://api.example.com/.well-known/agent.json.

Authorization (optional): If the remote agent requires authentication, provide the header to send with each request:

  • Header Name: The name of the auth header. Defaults to Authorization.
  • Header Value: The header value, such as Bearer <token>. Stored securely as a Squid secret.
  1. Click Test Connection to verify that Squid can fetch the agent card, then add the connector.

Using the A2A connector in your application​

No-code Studio​

  1. Navigate to the Studio tab in the Squid Console.

  2. Open (or create) the agent that should delegate to the remote agent.

  3. Click Add Abilities and select the A2A connector you created earlier.

  4. In the When to Use field, describe when the agent should consult the remote agent, such as "Call this when the user asks about shipping logistics."

  5. Click on Test and ask a question that should be delegated to the remote agent.

Using the Squid SDK​

If you are creating your AI agent with the Squid SDK, connect the A2A connector by adding it to the connectedIntegrations option of the ask() function:

await this.squid
.ai()
.agent('AGENT_ID')
.ask('What is the shipping status of order 1234?', {
connectedIntegrations: [
{
integrationId: 'A2A_CONNECTOR_ID',
integrationType: 'a2a',
description: 'Call this agent for shipping and logistics questions',
},
],
});

Limitations​

  • A stored long-running task has a fixed 24-hour deadline; after that, it can no longer be resumed.
  • The connector is outbound only: it lets a Squid agent call an external A2A agent. To expose capabilities from your Squid backend to other systems, see the MCP server documentation.
Connecting Squid agents to each other

To have one Squid agent delegate to another Squid agent in the same application, you don't need A2A; use connected agents instead.