API Quick Reference

A condensed overview of all public types, traits, and functions across the a2a-rust crates.

Wire Types (a2a-protocol-types)

Core Types

TypeDescription
TaskUnit of work with ID, status, history, artifacts
TaskIdNewtype wrapper for task identifiers
TaskStateEnum: Submitted, Working, InputRequired, AuthRequired, Completed, Failed, Canceled, Rejected
TaskStatusState + optional message + timestamp
TaskVersionMonotonically increasing version number
ContextIdConversation context identifier

Messages

TypeDescription
MessageStructured payload with ID, role, parts
MessageIdNewtype wrapper for message identifiers
MessageRoleEnum: User, Agent
PartContent unit: text, file, or data
PartContentEnum: Text, File, Data

Artifacts

TypeDescription
ArtifactResult produced by an agent
ArtifactIdNewtype wrapper for artifact identifiers

Events

TypeDescription
StreamResponseEnum: Task, Message, StatusUpdate, ArtifactUpdate
TaskStatusUpdateEventStatus change notification
TaskArtifactUpdateEventArtifact delivery notification

Agent Card

TypeDescription
AgentCardRoot discovery document
AgentInterfaceTransport endpoint descriptor
AgentCapabilitiesCapability flags (streaming, push, extended card)
AgentSkillDiscrete agent capability
AgentProviderOrganization info

Parameters

TypeDescription
MessageSendParamsSendMessage / SendStreamingMessage input
SendMessageConfigurationOutput modes, history, push config
TaskQueryParamsGetTask input
ListTasksParamsListTasks input with filters and pagination
CancelTaskParamsCancelTask input
TaskIdParamsSubscribeToTask input

Push Notifications

TypeDescription
TaskPushNotificationConfigWebhook registration
AuthenticationInfoWebhook auth credentials

Responses

TypeDescription
SendMessageResponseEnum: Task or Message
TaskListResponsePaginated task list

Errors

TypeDescription
A2aErrorProtocol-level error
ErrorCodeStandard error codes
A2aResult<T>Alias for Result<T, A2aError>

JSON-RPC

TypeDescription
JsonRpcRequestJSON-RPC 2.0 request envelope
JsonRpcErrorJSON-RPC error object
JsonRpcVersionVersion marker ("2.0")

Client (a2a-protocol-client)

Core Types

TypeDescription
A2aClientMain client for calling remote agents
ClientBuilderFluent builder for client configuration
EventStreamAsync SSE event stream
RetryPolicyConfigurable retry with exponential backoff

Client Methods

MethodReturnsDescription
send_message(params)SendMessageResponseSynchronous send
stream_message(params)EventStreamStreaming send
get_task(params)TaskRetrieve task by ID
list_tasks(params)TaskListResponseQuery tasks
cancel_task(id)TaskCancel a running task
subscribe_to_task(id)EventStreamRe-subscribe to task events
set_push_config(config)TaskPushNotificationConfigCreate push config
get_push_config(task_id, id)TaskPushNotificationConfigGet push config
list_push_configs(params)ListPushConfigsResponseList push configs
delete_push_config(task_id, id)()Delete push config
get_authenticated_extended_card(params)AgentCardGet extended card

Interceptors

TypeDescription
CallInterceptorRequest/response hook trait
InterceptorChainOrdered interceptor sequence

Transport

TypeDescription
TransportPluggable transport trait
JsonRpcTransportJSON-RPC 2.0 transport
RestTransportREST/HTTP transport

Server (a2a-protocol-server)

Core Types

TypeDescription
RequestHandlerCentral protocol orchestrator
RequestHandlerBuilderFluent builder for handler configuration
RequestContextInformation about the incoming request

Traits

TraitDescription
AgentExecutorAgent logic entry point
TaskStoreTask persistence backend
PushConfigStorePush config persistence
PushSenderWebhook delivery
ServerInterceptorServer-side middleware
AgentCardProducerDynamic agent card generation
DispatcherHTTP dispatch trait (for serve())

Dispatchers

TypeDescription
JsonRpcDispatcherJSON-RPC 2.0 HTTP dispatcher (implements Dispatcher)
RestDispatcherRESTful HTTP dispatcher (implements Dispatcher)

Server Startup

FunctionDescription
serve(addr, dispatcher)Bind + accept loop (blocking)
serve_with_addr(addr, dispatcher)Bind + spawn, returns SocketAddr

Built-in Implementations

TypeDescription
InMemoryTaskStoreIn-memory task store with TTL
InMemoryPushConfigStoreIn-memory push config store
HttpPushSenderHTTP webhook delivery with SSRF protection
StaticAgentCardHandlerStatic agent card with HTTP caching
DynamicAgentCardHandlerDynamic agent card with producer

Streaming

TypeDescription
EventEmitterErgonomic event emission helper
EventQueueWriterWrite events to a stream
EventQueueReaderRead events from a stream
EventQueueManagerManages stream lifecycle
InMemoryQueueWriterBounded channel writer
InMemoryQueueReaderBounded channel reader

Configuration

TypeDescription
CorsConfigCross-origin policy
TaskStoreConfigTTL and capacity for in-memory store
ServerErrorServer-level error type
ServerResult<T>Alias for Result<T, ServerError>

SDK (a2a-protocol-sdk)

Modules

ModuleRe-exports
a2a_protocol_sdk::typesAll a2a-protocol-types exports
a2a_protocol_sdk::clientAll a2a-protocol-client exports
a2a_protocol_sdk::serverAll a2a-protocol-server exports
a2a_protocol_sdk::preludeMost commonly used types

Prelude Contents

The prelude includes the most commonly used types from all three crates — see Project Structure for the full list.

Constructors Cheatsheet

#![allow(unused)]
fn main() {
// Task status
TaskStatus::new(TaskState::Working)
TaskStatus::with_timestamp(TaskState::Completed)

// Messages and parts
Part::text("hello")
Part::file_bytes(base64_string)
Part::file_uri("https://...")
Part::data(json_value)

// Artifacts
Artifact::new("artifact-id", vec![Part::text("content")])

// IDs
TaskId::new("task-123")
ContextId::new("ctx-456")
MessageId::new("msg-789")

// Capabilities (non_exhaustive — use builder)
AgentCapabilities::none()
    .with_streaming(true)
    .with_push_notifications(false)

// Push configs
TaskPushNotificationConfig::new("task-id", "https://webhook.url")
}

Next Steps