API Quick Reference

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

This page is a curated selection, kept short enough to scan. For the exhaustive, always-current listing — every item, every signature, generated from the code (docs.rs builds it for each release; the deploy builds it from main under /dev/api/) — see the generated API documentation.

Jump to the crate you are using, or straight to the constructors cheatsheet: one compiled block that builds the values you need most, from task states, parts, artifacts and ids to capabilities, an agent card and a push config.

CrateWhat you find there
a2a-protocol-typesWire types: tasks, messages, artifacts, agent cards, security schemes, errors, JSON-RPC envelopes
a2a-protocol-clientThe client, discovery, interceptors, authentication helpers, transports
a2a-protocol-serverThe handler and its builder, executors, dispatchers, stores, configuration
a2a-protocol-sdkThe umbrella crate: re-exports, telemetry, the prelude

Every name below is checked against the crates by scripts/check_api_reference.py in CI, so a type that gets renamed cannot leave a stale entry here. The same script checks the other direction at the crate roots: every item a crate re-exports from its lib.rs — the names you reach as use a2a_protocol_types::X — must have a row on this page. Deeper module items are rustdoc's job.

Wire Types (a2a-protocol-types)

Modules

ModuleContents
agent_cardAgent card and capability discovery types
approvalThe approval extension: ApprovalRequest, ApprovalDecision, and action_digest (signing feature) for binding a person's answer to an exact action
artifactArtifact types for the A2A protocol
auditTamper-evident audit records: schema, hash chains, signed checkpoints, verify_chain (audit feature)
auth_rejectionWhy a request was refused on authentication or authorization grounds
budgetThe budget extension: Budget, a deadline and named meters a delegated turn may spend, and BudgetStatus, what is left and spent (ADR 0023)
delegation_journalA supervisor's record of the children it delegated to, so a restart can find them: the DelegationJournal trait, DelegationRecord and an in-memory journal (ADR 0030)
errorA2A protocol error types
eventsServer-sent event types for A2A streaming
extensionsAgent extension and card-signature types
failureWhy a task failed, as a class a caller can match on
idempotencyClient-supplied idempotency keys for message/send, as a declared extension
jsonrpcJSON-RPC 2.0 envelope types
leaseThe lease extension: Lease, a delegated task's time to live, granted on the message that starts it and renewed by a GetTask that activates the extension
lineageThe lineage extension: Lineage (its root, depth and parent task id), the job a task belongs to; Lineage::child for a delegated task; tree arranges tasks into a job's tree (ADR 0034)
messageMessage types for the A2A protocol
methodThe A2A v1.0 service methods, mirrored from the ratified specification
paramsJSON-RPC method parameter types
provenanceMarks messages and artifacts as AI-generated and signs them (mark_ai_generated; sign_content, verify_content with the signing feature)
protoCanonical A2A protobuf message types (lf.a2a.v1) and conversions (proto feature)
pushPush notification configuration types
requiredThe REQUIRED fields of a2a.proto neither wire format's parser enforces, checked the same way at both ends (spec §5.7)
responsesRPC method response types
securitySecurity scheme types for A2A agent authentication
serde_helpersSerialization helpers for reducing allocation overhead
signingAgent card signing and verification (spec §8.4) (signing feature)
steeringThe steering extension: declare marks a message as a message to a running task, Receipt and Delivery say where the server put it (ADR 0036)
taskTask types for the A2A protocol
trace_contextW3C traceparent / tracestate: parse, validate, derive a child

Protocol Constants

ConstantDescription
A2A_VERSIONA2A protocol version string, in the Major.Minor wire form ("1.0")
A2A_CONTENT_TYPEThe registered A2A media type (spec §14.1.1), accepted on ingress by the HTTP bindings alongside JSON_CONTENT_TYPE, and the HTTP+JSON binding's response type unless the request prefers application/json or asks only for text/event-stream
JSON_CONTENT_TYPEapplication/json: the JSON-RPC binding's content type, and the HTTP+JSON binding's when the request's Accept prefers it (or asks only for text/event-stream)
A2A_VERSION_HEADERHTTP header name for the A2A protocol version (A2A-Version)
A2A_EXTENSIONS_HEADERHTTP header name for extension activation (spec §14.2.2)
WEBSOCKET_BINDING_URIThis project's identifier for its §12 WebSocket binding, as AgentInterface::protocol_binding

Core Types

TypeDescription
TaskUnit of work with ID, status, history, artifacts
TaskIdNewtype wrapper for task identifiers
TaskStateEnum: Unspecified, 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: Unspecified, User, Agent
PartContent unit: text, raw, url, or data
PartContentEnum: Text, Raw, Url, Data
FileContentContent of a file part. Deprecated: exists for backward compatibility with v0.3; in v1.0 use Part::raw or Part::url

Artifacts

TypeDescription
ArtifactResult produced by an agent. Call validate() to check non-empty parts.
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

Extensions

TypeDescription
AgentExtensionDescribes an optional extension that an agent supports
AgentCardSignatureA cryptographic signature over an AgentCard

Security Schemes

TypeDescription
SecuritySchemeA security scheme supported by an agent
NamedSecuritySchemesA map from security scheme name to its definition, as used in AgentCard.securitySchemes
SecurityRequirementA security requirement object mapping scheme names to their required scopes
StringListA list of strings used within a SecurityRequirement map value
ApiKeySecuritySchemeAPI key security scheme: a token sent in a header, query parameter, or cookie
ApiKeyLocationWhere an API key is placed in the request
HttpAuthSecuritySchemeHTTP authentication security scheme (Bearer, Basic, etc.)
OAuth2SecuritySchemeOAuth 2.0 security scheme
OAuthFlowsAvailable OAuth 2.0 flows for an OAuth2SecurityScheme
AuthorizationCodeFlowOAuth 2.0 authorization code flow
ClientCredentialsFlowOAuth 2.0 client credentials flow
DeviceCodeFlowOAuth 2.0 device authorization flow (RFC 8628)
ImplicitFlowOAuth 2.0 implicit flow (deprecated; retained for compatibility)
PasswordOAuthFlowOAuth 2.0 resource owner password credentials flow (deprecated but in spec)
OpenIdConnectSecuritySchemeOpenID Connect security scheme
MutualTlsSecuritySchemeMutual TLS security scheme

Parameters

TypeDescription
MessageSendParamsSendMessage / SendStreamingMessage input
SendMessageConfigurationOutput modes, history, push config
TaskQueryParamsGetTask input
ListTasksParamsListTasks input with filters and pagination
CancelTaskParamsCancelTask input
TaskIdParamsSubscribeToTask input
GetPushConfigParamsGetTaskPushNotificationConfig input
DeletePushConfigParamsDeleteTaskPushNotificationConfig input
ListPushConfigsParamsListTaskPushNotificationConfigs input
GetExtendedAgentCardParamsGetExtendedAgentCard input
AcceptedFieldsTrait: the JSON keys a request type accepts, in both protobuf spellings

Push Notifications

TypeDescription
TaskPushNotificationConfigWebhook registration
AuthenticationInfoWebhook auth credentials

Responses

TypeDescription
SendMessageResponseEnum: Task or Message
TaskListResponsePaginated task list
ListPushConfigsResponsePaginated push config list
AuthenticatedExtendedCardResponseType alias for AgentCard

Serialization Helpers

TypeDescription
SerBufferThread-local reusable serialization buffer; serialize still returns an owned Vec<u8>. In the published results (2026-10-14) it is about 1.4x faster than to_vec at 64 and 256 bytes, and within 6 % of it from 1 KiB up
deser_from_strserde_json::from_str behind a helper. The wire types own their strings, so nothing is borrowed and allocations do not fall
deser_from_sliceThe same from &[u8]: checks UTF-8, then parses as deser_from_str does; falls back to serde_json::from_slice when the bytes are not UTF-8

Timestamps

FunctionDescription
utc_now_iso8601()Returns the current UTC time as an ISO 8601 string with millisecond precision
unix_millis_to_iso8601(millis)Formats Unix-epoch milliseconds as an ISO 8601 UTC string with millisecond precision; a pre-1970 instant is written as itself, and one outside years 0000-9999 clamps to 0000-01-01 or the end of 9999-12-31
parse_iso8601_to_unix_millis(s)Parses an ISO 8601 / RFC 3339 timestamp into milliseconds since the Unix epoch; None for anything structurally invalid

Errors

TypeDescription
A2aErrorProtocol-level error
ErrorCodeStandard error codes
AuthRejectionA refused credential an A2aError carries: its kind and WWW-Authenticate challenge
AuthRejectionKindUnauthenticated (HTTP 401, gRPC UNAUTHENTICATED) or PermissionDenied (HTTP 403, gRPC PERMISSION_DENIED)
A2aResult<T>Alias for Result<T, A2aError>

JSON-RPC

TypeDescription
JsonRpcRequestJSON-RPC 2.0 request envelope
JsonRpcErrorJSON-RPC error object
JsonRpcVersionVersion marker ("2.0")
JsonRpcResponseJSON-RPC 2.0 response: either a success with a result or an error with an error object
JsonRpcSuccessResponseA successful JSON-RPC 2.0 response
JsonRpcErrorResponseAn error JSON-RPC 2.0 response
JsonRpcRequestIdA JSON-RPC 2.0 request identifier with three distinct states
JsonRpcIdA JSON-RPC 2.0 response identifier

Client (a2a-protocol-client)

Modules

ModuleContents
authAuthentication interceptor and credential storage
balanceCalls spread over the endpoints of one agent (EndpointSource, StaticEndpoints, DnsEndpoints), with ejection and opt-in hedging (BalancePolicy, Ejection, Hedge; ClientBuilder::with_balancing, ADR 0050)
builderFluent builder for A2aClient
clientThe A2aClient itself
configClient configuration types
delegationDelegation: a task sent to another agent and cancelled with its parent — on the parent's cancel, a lost stream, or a dropped handle; DelegationOptions::with_lineage gives the child its job's lineage
delegationDelegation: a task sent to another agent and cancelled with its parent — on the parent's cancel, a lost stream, or a dropped handle; HandOffPolicy bounds how often it continues a child whose server handed its turn back (ADR 0054)
discoveryAgent card discovery with HTTP caching
errorClient error types
interceptorRequest/response interceptor infrastructure
jwksfetch_jwks: a JWK Set from a trusted HTTPS URL, bounded in size and time, for verifying card signatures; it sends only the headers set with CardFetchOptions::with_jwks_header (signing feature)
methodsPer-method client helpers
retryConfigurable retry policy for transient client errors
streamingSSE client-side streaming support
testingScriptedPeer: a misbehaving agent on any binding (stall, cut-off, mis-frame, 401), for testing a client's failure handling (testing feature)
tlsTLS connector via rustls (tls-rustls feature)
token_providerToken acquisition: TokenProvider, OAuth 2.0 client-credentials, and OIDC discovery
otel_baggageW3C baggage on outbound calls, opt-in by key, and which propagators the environment turns on
trace_propagationCarrying W3C trace context on outbound calls
transportTransport abstraction for A2A client requests
version_querySending A2A-Version as a request parameter (§3.6.1)
webhookThe receiving side of push notifications: WebhookReceiver, new_notification_token (webhook feature, default on)

Core Types

TypeDescription
A2aClientMain client for calling remote agents
ClientBuilderFluent builder for client configuration
ClientConfigConfiguration for an A2aClient instance
EventStreamAsync SSE event stream
RetryPolicyConfigurable retry with exponential backoff
RetryBudgetRetries as a bounded fraction of calls, so retries cannot multiply an overload (RetryPolicy::with_budget)
HttpPoolOne set of HTTP connections many clients share, with an optional maximum connection lifetime, HTTP/2 PING and idle limits (ClientBuilder::with_pool, HttpPool::shared()), and per-origin state: a circuit breaker, an in-flight cap and a retry budget shared by its clients (HttpPool::origins()); needs tls-rustls
HttpPoolBuilderBuilds an HttpPool: TLS configuration, connect and idle timeouts, idle connections per host, connection lifetime, HTTP/2 keep-alive (HttpPool::builder())
OriginSnapshotOne origin's state from HttpPool::origins(): calls in flight, how much longer it is ejected, failures and ejections in a row
CredentialPreflightWhat a client built from a card does with a call whose credential matches none of the card's security requirements (§3.1.11): off, warn (default) or refuse
CurrentTraceThe trace the current task runs under, and how to start one
TracePropagationInterceptorWrites traceparent onto every outbound request
BaggagePolicyWhich W3C baggage entries cross the wire: Off (default), Keys([...]), All
PropagatorsWhich propagators the environment's propagator list turns on: tracecontext, baggage
VersionQueryInterceptorAdds A2A-Version to every request's query parameters, beside the header
ClientErrorErrors that can occur during A2A client operations
ClientResult<T>Alias for Result<T, ClientError>

Discovery

FunctionDescription
new_message_id()A fresh UUID v4 MessageId for a message about to be sent (in the SDK prelude too)
resolve_agent_card(base_url)async — fetches the AgentCard from the standard well-known path; no headers, 30 s budget
resolve_agent_card_with_options(base_url, &options)async — the same with the headers and budget in a CardFetchOptions (discovery module; fetch_card_from_url_with_options for an absolute URL)
CachingCardResolverA private RFC 9111 cache of one card: one HTTP client (or an HttpPool's, with_pool), one fetch at a time across clones, stale-if-error (with_stale_if_error, and the card's own directive), opt-in refresh jitter (discovery module)
CardCacheOne shared CachingCardResolver per card URL with one set of options, bounded (with_max_entries, default 1024), 10% refresh jitter (discovery module)

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
follow_task(id, poll_every)TaskFollowFollow a task to its end: subscribe when the agent streams, poll GetTask when it does not (§7.6.2)
subscribe_to_task_from(id, last_event_id)EventStreamResume a broken stream from its last SSE id: (sends Last-Event-ID)
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_extended_agent_card()AuthenticatedExtendedCardResponseGet extended card

Interceptors

TypeDescription
CallInterceptorRequest/response hook trait
InterceptorChainOrdered interceptor sequence
ClientRequestA logical A2A request as seen by interceptors
ClientResponseA logical A2A response as seen by interceptors

Authentication

TypeDescription
AuthInterceptorA CallInterceptor that injects Authorization headers from a CredentialsStore
CredentialsStorePersistent storage for auth credentials, keyed by session + scheme
InMemoryCredentialsStoreAn in-memory CredentialsStore backed by an RwLock<HashMap>
SessionIdOpaque identifier for a client authentication session
TokenProviderA source of bearer access tokens
StaticTokenProviderA TokenProvider that always returns the same fixed token
OAuth2ClientCredentialsA TokenProvider implementing the OAuth 2.0 client credentials grant (RFC 6749 §4.4) with caching and proactive refresh
BearerAuthInterceptorA CallInterceptor that injects a bearer token from a TokenProvider before every request

Webhook Receiver

TypeDescription
WebhookReceiverChecks a push notification's token, Authorization, body and task; suppresses duplicates; optional per-config rate limit
WebhookOutcomeAccepted, Duplicate or Rejected, with the HTTP status to answer
WebhookRejectionWhy a notification was refused: 401, 400, 403 or 429

Transport

TypeDescription
TransportPluggable transport trait
JsonRpcTransportJSON-RPC 2.0 transport
RestTransportREST/HTTP transport
WebSocketTransportWebSocket transport (websocket feature)
WebSocketTransportConfigConfiguration for WebSocketTransport::connect_with_config (websocket feature)
GrpcTransportgRPC transport (grpc feature); dials host:port targets and http(s):// URLs
GrpcBareAddressSchemeHow a bare host:port gRPC target is dialled: TLS except loopback (default), always TLS, or always plaintext

Server (a2a-protocol-server)

Modules

ModuleContents
admissionAdmission, the opt-in gate in front of the send path set with RequestHandlerBuilder::with_admission: a capacity, TenantShare reservations, a bounded wait inside the send's budget, priority classes and weighted rounds; AdmissionLoad is what RequestHandler::admission_load reports (ADR 0045)
agent_cardAgent card HTTP handlers (static, dynamic, and caching utilities)
approvalApprovalGate: admits an approval decision only from an allowed, authenticated approver, for the pending request and its digest, and with with_quorum(n) only once n distinct approvers have approved (recorded under QUORUM_METADATA_KEY); VerifiedApproval is what the executor sees
auditAuditLog, its stores, retention and legal holds; records every call, run, task event and cancel request (audit feature); AuditPrivacy, AuditLog::with_privacy, reveal, digest_matches and erase_subject protect who and what records name and erase a person (audit and encryption)
authServer-side authentication interceptors
builderBuilder for RequestHandler
call_contextCall context for server-side interceptors
conformanceGrades an AgentExecutor against the protocol invariants, and with conformance::halt a HaltStore and a handler's halt end to end (conformance feature)
dispatchHTTP dispatch layer — JSON-RPC and REST routing
errorServer-specific error types
executorAgent executor trait
executor_helpersErgonomic helpers for implementing AgentExecutor
handlerCore request handler — protocol logic layer
interceptorServer-side interceptor chain
metricsMetrics hooks for observing handler activity
otelOtelMetrics (otel feature, on by default) and Telemetry (OTLP traces, metrics and logs; the Langfuse preset; otlp feature)
profileDeployment profiles, which combine. Profile::Auditable turns on the audit trail and an approval gate, with a build() that refuses a log that is not required or not signed, a chain with no authenticator, or a builder that has not said how callers' tasks relate (audit feature). Profile::Production refuses a handler with no authenticator, halt store, lease store or content signer (ADR 0025, ADR 0027; the signer needs the signing feature). Profile::DurableProduction refuses stores that keep their state in this process; Profile::LocalDevelopment says that is intended. ProfileReport (RequestHandler::profile_report) lists what was checked, what an escape hatch gave up, and what startup cannot verify
pushPush notification configuration storage and delivery
rate_limitFixed-window rate limiter as a ServerInterceptor
request_contextRequest context passed to the AgentExecutor
serveServer, ServeConfig, ServeReport, Dispatcher, shutdown_signal (and the deprecated serve(), serve_with_addr)
steeringSteering a running task (ADR 0036): SteeringConfig, set with RequestHandlerBuilder::with_steering, bounds the inbox and the message size; Inbox is what RequestContext::inbox gives an executor, and Steered a message in it
storeTask storage backend
skillsAgent Skills in the tool loop: SkillCatalog, SkillsConfig, SkillSource and the two tools; scripts are never run (skills feature, ADR 0035)
streamingStreaming infrastructure for SSE responses and event queues
tenant_configPer-tenant resource limits for multi-tenant A2A servers
tenant_resolverTenant resolution for multi-tenant A2A servers
tool_loopTool calling inside a task: the model/tool loop, its executor, and a chat-completions client (tool-loop feature, ADR 0022)
url_guardSSRF checks for URLs an agent fetches: check_public_url, resolve_public_url, resolve_public_addrs

Constants

ConstantDescription
CORS_ALLOW_ALLCORS Access-Control-Allow-Origin header value for public agent cards
A2A_VERSION_METADATA_KEYThe service parameter naming the A2A protocol version, spelled the way a non-HTTP binding carries it
PEER_ADDR_KEYThe headers-map key (":peer-addr") under which a binding records the connection's address for CallContext::peer_addr
PEER_CERTIFICATE_KEYThe headers-map key (":peer-certificate") under which a binding records the client's mutual-TLS certificate, base64 DER, for CallContext::peer_certificate

Core Types

TypeDescription
RequestHandlerCentral protocol orchestrator
RequestHandlerBuilderFluent builder for handler configuration
RequestContextPer-execution context (task ID, message, etc.)
CancellationTokenThe type of RequestContext::cancellation_token, re-exported so an executor need not depend on tokio-util to name it
CallContextPer-request metadata (request ID, headers, tenant)
SteeringConfigTurns steering on and bounds it: the inbox's capacity (16), the message size (64 KiB), and whether a handed-off message is announced with PostgreSQL notifications
InboxThe messages sent to a running turn, oldest first, bounded: try_recv, recv().await, len, close; RequestContext::inbox is None unless steering is on
SteeredA steering message as the executor receives it: the message and who sent it (from)
HandlerLimitsConfigurable validation limits
TerminalConfirmationWhat a stream is told of a terminal event the store did not confirm: Required (the default) ends the stream with UNAVAILABLE; BestEffort delivers the event as emitted (HandlerLimits::terminal_confirmation)
InboundTracePolicyWhat this handler does with a traceparent an as-yet unauthenticated peer sent (W3C Trace Context §7.2)
MIN_MESSAGE_ID_LENGTHThe floor message.id's length bound is never taken below: 36, a hyphenated UUID
SendMessageResultResult of RequestHandler::on_send_message: a synchronous response or a streaming reader
ShutdownReportWhat a shutdown actually managed to do (live queues it had to destroy, whether executor cleanup completed)
InFlightReportWhat RequestHandler::finish_in_flight / cancel_in_flight did: tasks that completed on their own, tasks cancelled, still running at the end of the grace period, whether everything finished
HaltScopeWhat RequestHandler::halt applies to: one job (HaltScope::root(tenant, root), ADR 0034), one tenant, or all
RequestHandler::running_in_root / halt_reason_for_rootThe turns of one job running in this process, with their lineage; why a job's sends are refused
RequestContext::lineage / child_lineageThe turn's job, and the lineage to give a task it delegates
HALTED_REASON, A2A_RUST_ERROR_DOMAINThe ErrorInfo reason (HALTED) and domain (a2a-rust.com) a halt refusal carries on every binding (ADR 0049)
HaltScopeWhat RequestHandler::halt applies to: one tenant, or all
LoadReportWhat RequestHandler::load reports: turns running, sends queued at the admission gate, the capacity, draining, halted; utilization_permille, to_json (the /load body) and header_value (ADR 0046)
LOAD_HEADERendpoint-load-metrics, the response header carrying the load in ORCA's text form when the handler is built with_load_reporting()
HaltReportWhat a halt did: stopped, the ids of the tasks whose token it fired, and persisted, whether the halt store took it (None without a store)
ConnectionPoolStatsStatistics about the HTTP connection pool
RpcCallOne finished inbound call as Metrics::on_rpc_call reports it: binding, method, duration, status (rpc.server.call.duration)
BindingSpanThe per-call server span and rpc.server.call.duration for a binding outside this crate, as the in-crate bindings record theirs (ADR 0013)
CustomBindingHow such a binding names itself: its rpc.system.name, its status for each ServerError, and optionally the status of a success
StreamEndA response stream's claim on the call it answers (BindingSpan::run_with): the call is recorded when the stream ends, as cancelled if the claim is dropped
StreamOutcomeHow a response stream ended: completed, failed with an error, or abandoned

Traits

TraitDescription
AgentExecutorAgent logic entry point
TaskStoreTask persistence backend
PushConfigCipherSeals push configs at rest in the SQL push-config stores (with_cipher; sqlite / postgres features)
ContentCipherSeals part content for EncryptedTaskStore; implement it to put a key-management service behind the store (encryption feature)
PushConfigStorePush config persistence
PushSenderWebhook delivery
ServerInterceptorServer-side middleware
AgentCardProducerDynamic agent card generation
ExtendedCardProviderChooses each caller's extended agent card (§13.3; with_extended_card_provider)
DispatcherHTTP dispatch trait (what Server::serve_with_shutdown serves)
MetricsPluggable metrics observer (requests, latency, errors)
TenantResolverExtracts tenant from request context
RateLimitCounterA request counter every replica shares
ToolModelOne completion turn of a model that can call tools: preamble, conversation and tool specs in, text and tool calls out, with the usage, model, id and finish reason the provider reported; server() says where it is served, for the spans (tool-loop feature)
ToolSomething a model may call: a name, a description, a JSON Schema, read_only (default false) and call(invocation), given the arguments and an idempotency key (tool-loop feature, ADR 0026)

Dispatchers

TypeDescription
JsonRpcDispatcherJSON-RPC 2.0 HTTP dispatcher (implements Dispatcher)
RestDispatcherRESTful HTTP dispatcher (implements Dispatcher)
CombinedDispatcherJSON-RPC and REST on one listener: a POST to the JSON-RPC path is JSON-RPC, the rest is REST (implements Dispatcher); with_websocket adds the WebSocket binding on the same port, upgraded at the JSON-RPC path (websocket feature, ADR 0055)
WebSocketUpgradesThe connections an HTTP dispatcher upgraded to WebSockets: open(), and close(within), which Server::serve_with_shutdown calls in its drain and an axum application calls itself (RestRouter::websocket_upgrades)
WebSocketDispatcherWebSocket dispatcher (websocket feature); with_serve_config(ServeConfig) takes the listener settings Server takes, and serve_with_shutdown(listener, signal) on an Arc of it serves (ADR 0052)
GrpcDispatchergRPC dispatcher (grpc feature); with_serve_config(ServeConfig) takes the listener settings Server takes, and serve_with_shutdown(listener, signal) serves (ADR 0052); with_rustls(rustls::ServerConfig) serves TLS through this crate's handshake, so a ReloadingCertResolver rotates it (grpc-tls and tls-rustls)
RestRouterAxum framework adapter (axum feature): an axum Router for the HTTP+JSON binding (into_router), and a Dispatcher that Server serves; A2aRouter is the same type under its original name (ADR 0053)
A2aRouterThe type RestRouter names (axum feature), under its original name; not deprecated (ADR 0053)

Server Startup

NameDescription
ServerA bound listener that has not started accepting yet; binding is separated from serving so the caller can learn the address. serve_with_shutdown(dispatcher, signal) serves any Dispatcher, the axum RestRouter included (ADR 0052)
serve(addr, dispatcher) -> io::Result<()>Deprecated since 0.16.0 (removed no earlier than 0.17.0): binds and drives the accept loop until the future is dropped; use Server
serve_with_addr(addr, dispatcher) -> io::Result<SocketAddr>Deprecated since 0.16.0 (removed no earlier than 0.17.0): binds, spawns the accept loop with no way to stop it, returns the bound SocketAddr; use Server
ServeConfigLimits applied to a Server; ServeConfig::production() makes it refuse plaintext beyond loopback and a binding the agent card does not declare (ADR 0025)
ServeReportWhat a shutdown did — Server::serve_with_shutdown, or the gRPC and WebSocket dispatchers' serve_with_shutdown: connections accepted, drained or abandoned, and (with a handler-backed dispatcher) the InFlightReport for its tasks; refused says why a ServeConfig::production() server declined to start
shutdown_signal() -> impl Future<Output = ()>Resolves on SIGTERM or SIGINT (Ctrl-C on non-Unix); pass it to Server::serve_with_shutdown so a pod stop drains in-flight work, returns from main, and lets a live Telemetry guard flush
DispatchConfigConfiguration for dispatch-layer limits shared by both JSON-RPC and REST dispatchers; with_base_path names a reverse proxy's path prefix
GrpcConfigConfiguration for the gRPC dispatcher (grpc feature)
validate_version_metadata(metadata, required)Validates the A2A version carried in a binding's request metadata

Executor Helpers

NameDescription
agent_executor!Macro: generates an AgentExecutor implementation from a closure-like syntax
boxed_futureWraps an async expression into a pinned, boxed, Send future

Tool Calling

All behind the tool-loop feature; the rest of the module (ToolCall, ChatMessage, ModelError, LoopError, …) is at tool_loop::.

TypeDescription
ToolLoopRuns model turns until the model answers without a call, bounded by with_max_turns (default 8); tool errors go back to the model, and a call written as text is run as one; with_agent_name and with_meter for its gen_ai.* metrics; with_model_retry sends a rate-limited turn again (off by default)
ToolLoopExecutorA ToolLoop as an AgentExecutor: Working, the answer and tool-trace artifacts, Completed; Failed as internal or budget-exhausted; with_drafts streams each turn's text to a draft-N artifact first
ToolSetThe tools a loop offers; refuses two of one name
OpenAiChatModelA ToolModel for POST {base}/chat/completions (OpenAI, llama-server, vLLM, Ollama) on the crate's hyper client; HTTPS with tls-rustls; streams for complete_streaming
TextSinkWhere ToolModel::complete_streaming hands each piece of a turn's text
InferenceLimitAt most max model turns in flight at one provider, shared by every loop holding a clone; max() and available() (ADR 0048)
LimitedModelA ToolModel that holds a slot of an InferenceLimit for each turn, streamed or not, and gives it back however the turn ends
ModelRetryToolLoop::with_model_retry's policy for a rate-limited turn (ModelError::RateLimited): 3 retries, 0.5 s doubling to 30 s with half jitter, or the provider's Retry-After spread by up to a quarter; never past max_delay or the budget's remaining time (ADR 0048)

Agent Skills

All behind the skills feature (it implies tool-loop), at skills::.

TypeDescription
SkillCatalogThe skills discover found in the configured directories and a list of SkillDiagnostics; never fails. prompt() is the catalog for the system prompt, tools() the tools that serve it, agent_skills() the entries for an agent card (off unless called)
SkillsConfigWhat to scan and the bounds: 32 skills, a 400-character description in the prompt, a 64 KiB body, a 64 KiB file read, each set with a with_max_*
SkillSourceOne directory of skills: operator(path) is trusted, project(path) is not read until with_trusted(true); with_follow_symlinks(true) follows a link to a skill directory
SkillOne skill: name, description, body, location, scope, and the optional fields the file had, with allowed_tools recorded and never used
SkillDiagnosticWhat discovery noticed: a Severity, a DiagnosticKind to match on, a path and a message
ActivateSkillToolactivate_skill: its name is an enum of the catalog's names; returns the instructions, the files the skill bundles and the scripts that are not run
ReadSkillFileToolread_skill_file: the text of a file under a skill's references/ or assets/, through the confined reader

ToolLoopExecutor::with_skills puts the catalog's prompt after the loop's preamble and adds the tools.

Built-in Implementations

TypeDescription
InMemoryTaskStoreIn-memory task store with TTL
EventHoldsWhat attached streams still owe from each task's event log, so a bounded log keeps it (store; TaskStore::hold_events, spec §3.5.2)
EventHoldOne stream's hold on a task's log, raised as it delivers and released on drop (store)
EncryptedTaskStoreWraps any TaskStore and seals every part at rest, bound to where it sits (store::encrypted; encryption feature)
Aes256GcmCipherAES-256-GCM over a key ring for EncryptedTaskStore, and a PushConfigCipher (encryption feature)
InMemoryPushConfigStoreIn-memory push config store
PushOutboxWhere webhook deliveries wait until delivered (push::outbox, ADR 0037); RequestHandlerBuilder::with_push_outbox
InMemoryPushOutboxIn-memory PushOutbox: retries outlast a delivery, not a restart
SqlitePushOutboxSQLite PushOutbox, table a2a_push_outbox (sqlite feature); with_cipher seals event bodies
PostgresPushOutboxPostgreSQL PushOutbox shared by every replica, claims with FOR UPDATE SKIP LOCKED (postgres feature); with_cipher
HttpPushSenderHTTP webhook delivery with SSRF protection; follows the proxy variables in every build, and with_proxy_resolved_names() lets a proxy resolve names this process cannot (ADR 0043)
SqliteTaskStoreSQLite task store (sqlite feature)
SqlitePushConfigStoreSQLite push config store (sqlite feature)
TenantAwareInMemoryTaskStoreMulti-tenant in-memory task store
TenantAwareInMemoryPushConfigStoreMulti-tenant in-memory push config store
TenantAwareSqliteTaskStoreMulti-tenant SQLite task store (sqlite feature)
TenantAwareSqlitePushConfigStoreMulti-tenant SQLite push config store (sqlite feature)
PostgresTaskStorePostgreSQL task store (postgres feature)
PostgresPushConfigStorePostgreSQL push config store (postgres feature)
TenantAwarePostgresTaskStoreMulti-tenant PostgreSQL task store (postgres feature)
TenantAwarePostgresPushConfigStoreMulti-tenant PostgreSQL push config store (postgres feature)
PgMigrationRunnerPostgreSQL migration runner (postgres feature)
PostgresDelegationJournalA supervisor's DelegationJournal in PostgreSQL, shared by its replicas (postgres feature; ADR 0030)
SqliteDelegationJournalA supervisor's DelegationJournal in a SQLite file, kept across a restart on one host (sqlite feature; ADR 0030)
StaticAgentCardHandlerStatic agent card with HTTP caching
DynamicAgentCardHandlerDynamic agent card with producer
HotReloadAgentCardHandlerAgent card with live reloading
HeaderTenantResolverTenantResolver that reads a configurable request header
BearerTokenTenantResolverTenantResolver that takes the Authorization: Bearer token as the tenant (a digest of it), or what a with_mapper closure makes of it; default() (and the deprecated new()) names the unverified token by its digest (tenant_resolver::tenant_id_for_token), so use with_mapper with a closure that verifies the token
PathSegmentTenantResolverTenantResolver that parses tenant from a configurable path segment
RateLimitInterceptorPer-caller rate limiting interceptor
PostgresRateLimitCounterA RateLimitCounter backed by a PostgreSQL table (postgres feature)
ApiKeyAuthInterceptorRejects requests whose API-key header is absent or not in the allowed set
BearerTokenAuthInterceptorRejects requests whose bearer token is absent or not in the allowed set
AuthFailureThrottleRefuses a peer whose credentials were refused too often, until its window ends
auth::MutualTlsAuthInterceptor::with_forwardedAlso names a caller from the client certificate a trusted TLS-terminating proxy forwarded (tls-rustls or grpc-tls)
auth::ForwardedClientCertWhere a proxy forwards the client certificate and which peers may: envoy (x-forwarded-client-cert), url_encoded_pem(header, ..) (nginx), aws_alb (x-amzn-mtls-clientcert)
ReloadingCertResolverA rustls certificate resolver that serves two PEM files and replaces the certificate on reload() or watch(interval); server_config() builds a configuration around it (tls-rustls)
PeerAddrRequest extension carrying the connection's address, which the dispatchers copy to CallContext::peer_addr
PeerCertificateRequest extension carrying the client's mutual-TLS certificate (DER), which the dispatchers pass to CallContext::peer_certificate
ServerInterceptorChainAn ordered chain of ServerInterceptor instances
CallOutcomeHow a call ended — succeeded, failed with the error sent, or cancelled — as ServerInterceptor::on_complete is told
MigrationA single SQLite schema migration (sqlite feature)
MigrationRunnerRuns schema migrations against a SQLite database (sqlite feature)
PgMigrationA single PostgreSQL schema migration (postgres feature)
NoopMetricsNo-op metrics implementation (the default without the otel feature)
OtelMetricsOpenTelemetry metrics (otel feature, on by default)

Streaming

NameKindDescription
EventEmitterstructErgonomic event emission helper (wraps an EventQueueWriter): status, text_artifact, artifact_chunk, complete_with and complete_with_text (the result artifact then Completed), fail, auth_required, request_approval
ArtifactChunkstructWhere an artifact update sits in its artifact (append, last), for EventEmitter::artifact_chunk: whole(), first(), append(), last()
EventQueueWritertraitWrite events to a task's event stream
EventQueueReadertraitRead events from a task's event stream
EventQueueManagerstructPer-task queue lifecycle manager (create / lookup / destroy); with_max_buffered_bytes bounds the bytes all its queues hold at once and buffered_bytes reports them (ADR 0047)
InMemoryQueueWriterstructBounded-channel EventQueueWriter implementation
InMemoryQueueReaderstructBounded-channel EventQueueReader implementation
StreamEventstructOne queued event and its position in the task's event log (the SSE id:)

Configuration

TypeDescription
CorsConfigCross-origin policy
TaskStoreConfigTTL and capacity for in-memory store
TenantStoreConfigConfiguration for TenantAwareInMemoryTaskStore
TenantContextThread-safe tenant context for scoping store operations
PerTenantConfigPer-tenant configuration for timeouts, capacity limits, and executor selection
TenantLimitsResource limits declared for a single tenant
RateLimitConfigConfiguration for RateLimitInterceptor
TrustedProxyAn address range (10.0.0.0/8) of reverse proxies whose forwarded header is believed; set on RateLimitConfig and AuthFailureThrottleConfig, and on ForwardedClientCert
ForwardedHeaderThe header the trusted proxies write the client address into: XForwardedFor (default) or RFC 7239 Forwarded; with_forwarded_header on RateLimitConfig and AuthFailureThrottleConfig
InvalidTrustedProxyWhy a string is not a TrustedProxy
AuthFailureThrottleConfigConfiguration for AuthFailureThrottle
PushRetryPolicyRetry policy for push notification delivery
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

Telemetry

ItemDescription
TelemetryOpenTelemetry for the process, from the standard OTEL_* environment: every signal is exported (to localhost when nothing names an endpoint) unless with_export_where_configured() limits it to the signals an endpoint names (otlp, on by default; a2a_protocol_server::otel::Telemetry)

Prelude Contents

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

Constructors Cheatsheet

use a2a_protocol_sdk::prelude::*;
use a2a_protocol_sdk::types::push::TaskPushNotificationConfig;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let base64_string = "aGVsbG8=";
let card = AgentCard::new("a", "1.0.0", AgentInterface::jsonrpc("http://localhost:3000")).with_description("An example agent");
// Task status
TaskStatus::new(TaskState::Working);
TaskStatus::with_timestamp(TaskState::Completed);

// Messages and parts (v1.0 wire format: flat oneof)
Part::text("hello");                   // → {"text": "hello"}
Part::raw(base64_string);              // → {"raw": "aGVsbG8="}
Part::url("https://...");              // → {"url": "https://..."}
Part::data(serde_json::json!({"k": 1})); // → {"data": {"k": 1}}
Part::file_bytes(base64_string);       // deprecated alias for raw(); prefer raw()
Part::file_uri("https://...");         // deprecated alias for url(); prefer url()
let wire = |p: Part| serde_json::to_value(p).unwrap();
assert_eq!(wire(Part::text("hello")), serde_json::json!({"text": "hello"}));
assert_eq!(wire(Part::raw(base64_string)), serde_json::json!({"raw": "aGVsbG8="}));
assert_eq!(wire(Part::url("https://...")), serde_json::json!({"url": "https://..."}));
assert_eq!(wire(Part::data(serde_json::json!({"k": 1}))), serde_json::json!({"data": {"k": 1}}));
assert_eq!(wire(Part::file_bytes(base64_string)), wire(Part::raw(base64_string)));
assert_eq!(wire(Part::file_uri("https://...")), wire(Part::url("https://...")));

// 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);

// Agent cards: `new` takes name, version and the first interface; `validate` also needs a description and a skill with a tag, so add both by `with_*`
AgentCard::new("my-agent", "1.0.0", AgentInterface::jsonrpc("http://localhost:3000"))
    .with_description("Does one thing well")
    .with_skill(AgentSkill::new("echo", "Echo", "Repeats").with_tags(["text"]))
    .with_interface(AgentInterface::grpc("http://localhost:50051"))
    .with_streaming(true);              // one flag; with_capabilities(..) for the rest

// Client-side: which interface `from_card` picked
ClientBuilder::from_card(&card)?.chosen_interface();   // Option<&AgentInterface>

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

Next Steps