A2a Error Handling logo

A2a Error Handling

Organization
OrcaQubits
a2a-error-handling

Implement A2A error handling — JSON-RPC errors, A2A-specific error codes, task failure states, retry strategies, and graceful degradation. Use when building robust error handling in A2A agents.

Overview

PublisherOrcaQubits
Repositoryagentic-commerce-skills-plugins
Skill namea2a-error-handling
Stars
40
Forks
17
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by OrcaQubits on GitHub. Read the source before you install it.

Installation

Install the A2a Error Handling AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/a2a-multi-agent/skills/a2a-error-handling
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins.git /tmp/agentic-commerce-skills-plugins
mkdir -p .claude/skills
cp -r /tmp/agentic-commerce-skills-plugins/a2a-multi-agent/skills/a2a-error-handling .claude/skills/a2a-error-handling
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable A2a Error Handling in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads A2a Error Handling on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so A2a Error Handling is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

A2A Error Handling

Before writing code

Fetch live docs:

  1. Fetch https://a2a-protocol.org/latest/specification/ for the error handling section
  2. Web-search site:github.com a2aproject A2A error codes for error code definitions
  3. Web-search site:github.com a2aproject a2a-samples error for error handling examples
  4. Fetch SDK docs for error classes and exception types

Conceptual Architecture

Error Categories

A2A has three categories of errors:

  1. JSON-RPC Protocol Errors — Malformed requests, invalid methods, parse failures
  2. A2A-Specific Errors — Protocol-level issues specific to A2A operations
  3. Task-Level Failures — The task itself fails during processing (task state → failed)

JSON-RPC 2.0 Error Format

All errors follow the JSON-RPC 2.0 error response format:

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

Standard JSON-RPC Error Codes

CodeNameMeaning
-32700Parse errorInvalid JSON
-32600Invalid requestNot a valid JSON-RPC request
-32601Method not foundMethod doesn't exist or isn't supported
-32602Invalid paramsMethod parameters are invalid
-32603Internal errorServer internal error

A2A-Specific Error Codes

CodeNameMeaning
-32001TaskNotFoundErrorThe referenced taskId doesn't exist
-32002TaskNotCancelableErrorTask is in a state that can't be canceled (terminal state)
-32003PushNotificationNotSupportedErrorAgent doesn't support push notifications
-32004UnsupportedOperationErrorThe requested operation is not supported
-32005ContentTypeNotSupportedErrorClient's accepted output modes don't match agent's capabilities
-32006InvalidAgentResponseErrorThe agent returned an invalid or malformed response
-32007ExtendedAgentCardNotConfiguredErrorExtended Agent Card is not configured
-32008ExtensionSupportRequiredErrorA required extension is not supported
-32009VersionNotSupportedErrorThe requested protocol version is not supported

Task Failure vs Protocol Error

Important distinction:

  • Protocol errors return a JSON-RPC error response — the request itself was invalid or couldn't be processed
  • Task failures return a normal response with the task in failed state — the request was valid but the task's processing failed

Example: If a client sends message/send with invalid JSON → -32700 (protocol error). If a client sends a valid message but the agent's LLM call fails → task state becomes failed with an error message.

Server-Side Error Handling

The server should:

  1. Validate JSON-RPC structure — Return -32600/-32700 for malformed requests
  2. Validate method — Return -32601 for unsupported methods
  3. Validate parameters — Return -32602 for invalid params
  4. Check task existence — Return -32001 for unknown task IDs
  5. Check capabilities — Return -32003/-32005 for unsupported features
  6. Handle extended card — Return -32007 if extended Agent Card is not configured
  7. Handle internal errors — Return -32603 for unexpected server errors
  8. Set task state — Transition to failed for task-level processing errors

Client-Side Error Handling

The client should:

  1. Parse the response — Check for error field vs result field
  2. Handle by error code — Different codes need different responses
  3. Retry transient errors — -32603 (internal error) may be retryable
  4. Don't retry permanent errors — -32601 (method not found) won't succeed on retry
  5. Handle task failures — Check task state for failed and read the error message
  6. Fallback — Try alternative agents if one fails

Retry Strategy

Error CodeRetryable?Strategy
-32700NoFix the request
-32600NoFix the request
-32601NoMethod not available on this agent
-32602NoFix the parameters
-32603YesExponential backoff, max 3 retries
-32001NoTask doesn't exist
-32002NoTask can't be canceled
-32005NoContent type mismatch
-32007NoExtended Agent Card not configured

Best Practices

  • Always include meaningful error messages, not just codes
  • Use the data field in JSON-RPC errors for additional debugging context
  • Log errors with request IDs and task IDs for traceability
  • Implement circuit breakers for agents that are consistently failing
  • Set task state to failed with a descriptive message when processing fails
  • Don't expose internal implementation details in error messages to external clients
  • Implement graceful degradation — if one agent in a pipeline fails, handle it upstream
  • Test error paths explicitly — they're as important as the happy path

Fetch the specification for the complete list of error codes, their semantics, and any error handling requirements before implementing.

Frequently asked questions

What does the A2a Error Handling AI skill do?

Implement A2A error handling — JSON-RPC errors, A2A-specific error codes, task failure states, retry strategies, and graceful degradation. Use when building robust error handling in A2A agents.

Why use A2a Error Handling on TypingMind?

Because you install it once and use it with any model. A2a Error Handling is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install A2a Error Handling in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/a2a-multi-agent/skills/a2a-error-handling. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use A2a Error Handling?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with A2a Error Handling?

As many as you like. As long as a model supports skills, you can use A2a Error Handling with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the A2a Error Handling AI skill free?

Yes. It is published on GitHub by OrcaQubits under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇