A2a jsonrpc transport

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

A2a jsonrpc transport is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Implement the A2A JSON-RPC 2.0 transport layer — request/response format, method routing, batch requests, and HTTP details. Use when building custom A2A transport handling or debugging protocol-level issues.

How to use this skill

Skill file

A2A JSON-RPC 2.0 Transport

Before writing code

Fetch live docs:

  1. Fetch https://a2a-protocol.org/latest/specification/ for the transport layer section
  2. Web-search site:github.com a2aproject A2A JSON-RPC transport for transport protocol details
  3. Fetch https://www.jsonrpc.org/specification for the JSON-RPC 2.0 base specification
  4. Fetch SDK docs for transport-level classes and middleware

Conceptual Architecture

Why JSON-RPC 2.0

A2A uses JSON-RPC 2.0 as its transport protocol because:

Request Format

Every A2A request is a JSON-RPC 2.0 request:

{
  "jsonrpc": "2.0",
  "method": "message/send",
  "id": "unique-request-id",
  "params": { ... }
}

Response Format

Success:

{
  "jsonrpc": "2.0",
  "id": "unique-request-id",
  "result": { ... }
}

Error:

{
  "jsonrpc": "2.0",
  "id": "unique-request-id",
  "error": {
    "code": -32600,
    "message": "Invalid Request",
    "data": { ... }
  }
}

HTTP Details

A2A Methods

| Method | Direction | Purpose |

|--------|-----------|---------|

| message/send | Client → Server | Send message, get synchronous response |

| message/stream | Client → Server | Send message, get SSE stream |

| tasks/get | Client → Server | Retrieve task by ID |

| tasks/cancel | Client → Server | Cancel a task |

| tasks/resubscribe | Client → Server | Re-subscribe to task's SSE stream |

| tasks/pushNotificationConfig/set | Client → Server | Register push notification |

| tasks/pushNotificationConfig/get | Client → Server | Get notification config |

| tasks/pushNotificationConfig/list | Client → Server | List notification configs |

| tasks/pushNotificationConfig/delete | Client → Server | Delete notification config |

| agent/authenticatedExtendedCard | Client → Server | Get extended Agent Card |

Method Routing

The server must route incoming requests by the method field:

  1. Parse the JSON body
  2. Validate JSON-RPC 2.0 structure
  3. Extract the method field
  4. Route to the appropriate handler
  5. Return the handler's result wrapped in a JSON-RPC response

Request IDs

Idempotency

A2A doesn't mandate built-in idempotency, but best practice is:

Best Practices

Fetch the specification for any additional transport requirements, header conventions, and method parameter schemas before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.