A2a Error Handlingのロゴ

A2a Error Handling

組織
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.

概要

公開者OrcaQubits
リポジトリagentic-commerce-skills-plugins
スキル名a2a-error-handling
スター
40
フォーク
17
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    OrcaQubitsがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルA2a Error HandlingをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/a2a-multi-agent/skills/a2a-error-handling
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでA2a Error Handlingを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にA2a Error Handlingを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、A2a Error Handlingは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

よくある質問

AIスキル「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.

TypingMindでA2a Error Handlingを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。A2a Error Handlingはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにA2a Error Handlingをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/a2a-multi-agent/skills/a2a-error-handlingを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

A2a Error Handlingを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

A2a Error Handlingは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもA2a Error Handlingを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「A2a Error Handling」は無料ですか?

はい。OrcaQubitsがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇