Skip to content

API Reference: JSON-RPC

The RabbitHole framework uses the JSON-RPC 2.0 specification for all communication between clients and the A2A server.

All messages are wrapped in a standard JSON-RPC envelope.

  • jsonrpc: "2.0"
  • id: int | str | None: A unique request ID.
  • method: str: The name of the method to be invoked (e.g., tasks/send).
  • params: object: The parameters for the method.
  • jsonrpc: "2.0"
  • id: int | str | None: The ID from the corresponding request.
  • result: any | None: The data returned by a successful method call.
  • error: JSONRPCError | None: An error object if the method call failed.

These are the primary RPC methods for interacting with tasks.

Submits a new task to the agent. This is a non-streaming method and will only return the final Task object after completion.

  • Request Params: TaskSendParams
  • Response Result: Task

Submits a new task and subscribes to real-time status and artifact updates. This is the recommended method for interactive clients.

  • Request Params: TaskSendParams
  • Response Result: A stream of TaskStatusUpdateEvent or TaskArtifactUpdateEvent objects.

Retrieves the current state of a previously submitted task.

  • Request Params: TaskQueryParams
  • Response Result: Task

Attempts to cancel a running task.

  • Request Params: TaskIdParams
  • Response Result: Task (reflecting the new CANCELED state).

The framework defines several standard JSON-RPC error codes.

CodeNameDescription
-32700JSONParseErrorThe received JSON was malformed.
-32600InvalidRequestErrorThe request object is not a valid JSON-RPC object.
-32601MethodNotFoundErrorThe requested method does not exist.
-32602InvalidParamsErrorThe parameters for the method are invalid.
-32603InternalErrorAn unexpected error occurred on the server.
-32001TaskNotFoundErrorThe requested task ID could not be found.
-32002TaskNotCancelableErrorThe task is in a state where it cannot be canceled.
-32003PushNotificationNotSupportedErrorThe agent does not support push notifications.