API ReferenceInterfacesJsonRpcResponseBase

title: Core. Json Rpc Response Base

A2A Node SDK - v0.1.0 / Modules / Core / JsonRpcResponseBase

Interface: JsonRpcResponseBase<T>

Core.JsonRpcResponseBase

Base interface for JSON-RPC responses

This interface defines the base structure for JSON-RPC 2.0 response messages, including the jsonrpc version, optional result and error fields, and optional request id. It’s parameterized by the result type for type safety.

Example

// Create a JSON-RPC response with a Task result
const response: JsonRpcResponseBase<Task> = {
  jsonrpc: '2.0',
  id: 'request-123',
  result: {
    id: 'task-456',
    name: 'Answer Question',
    status: 'completed',
    createdAt: new Date().toISOString(),
    updatedAt: new Date().toISOString()
  }
};

Type parameters

NameTypeDescription
TanyResponse result type

Table of contents

Properties

Properties

error

Optional error: Object

Type declaration

NameType
codenumber
data?any
messagestring

id

Optional id: string | number


jsonrpc

jsonrpc: "2.0"


result

Optional result: T