Skip to main content

Module required

Module required 

Source
Expand description

The REQUIRED fields of a2a.proto that neither wire format’s parser enforces, checked the same way at both ends.

Spec §5.7: a field marked REQUIRED “MUST be present and set in valid messages”; implementations “SHOULD validate these requirements and reject messages with missing required fields”, and a required array “MUST contain at least one element”. The JSON bindings refuse a missing key when they parse, and the gRPC conversion (module proto, feature proto) refuses the absent field proto3 reads as "" or 0. What both still read as a value is checked here: an empty string sent explicitly, an empty required array (ProtoJSON omits an empty repeated field, so neither format can refuse its absence at parse time), and over JSON an explicit TASK_STATE_UNSPECIFIED or ROLE_UNSPECIFIED.

Every check answers InvalidParams naming the field, as the server’s refusal of the same object does; a client reports it as the agent’s invalid response.

Functions§

check_artifact
Refuses an artifact with no artifact_id or no parts.
check_card
Refuses an agent card AgentCard::validate or AgentCard::validate_security_schemes refuses: the rules a server applies before it publishes one.
check_event
Refuses event when a REQUIRED field of its content is unset.
check_message
Refuses a message with no message_id, a role of ROLE_UNSPECIFIED, or no parts; which names it in the error (“history message”).
check_push_config
Refuses a push-notification config with no webhook url, or whose authentication has no scheme.
check_received_event
check_event, and the REQUIRED ids an event carries: a task’s id, and a status or artifact update’s task_id and context_id. What a client runs on each streamed event.
check_response
check_task or check_message, for what a blocking SendMessage returned.
check_status
Refuses a status in TASK_STATE_UNSPECIFIED, or whose message lacks a REQUIRED field.
check_task
Refuses a task with no id, or whose status, artifacts or history lack a REQUIRED field (see check_event).