Text part (A2A)
An A2A Part whose content is a string in its text field. It carries prompts, replies and status messages, optionally labelled with a media type.
A text part is an A2A Part whose content member is text, a plain string, and it is the usual way agents send prompts, answers, clarifying questions and status messages to each other.
Shape. In v1.0 a Part holds exactly one content member: text, raw, url or data. When text is the member that is set, the part is a text part. Like any part, it can also carry mediaType, filename and metadata. The media type is optional, and setting it tells the receiver how to treat the string, for example text/plain or text/markdown.
{"text": "The replacement unit ships today. Tracking follows in a separate message.", "mediaType": "text/plain"}
Version 0.3 wrote the same part with an explicit discriminator, {"kind": "text", "text": "..."}. Appendix A.2.1 of the specification lists the removal of kind as a breaking change in v1.0, so a v1.0 parser identifies the part by its key alone.
Where text parts appear.
- In a client’s Message, as the request itself.
- In a task’s
status.message, when the agent explains progress or asks for input inTASK_STATE_INPUT_REQUIRED. - In an Artifact, when the result of a task is prose.
Section 3.7 says results should go in artifacts, and messages should carry communication. A text answer that is the outcome of the work therefore belongs in an artifact part.
Choosing text or data. Text suits content a person or a language model reads. When the receiver needs fields it can validate, such as an order number or an amount, a data part is safer than a sentence the other side must parse. Both can appear in one message.
Security. Text from another agent is untrusted input. The specification’s media type registration requires implementations to sanitize user-provided content to prevent injection attacks, and that applies to any agent that feeds a received text part into a model prompt.
Neighbouring terms. Data parts carry structured JSON, and file parts carry files by bytes or by URL.
Sources
- A2A protocol definition (a2a.proto): Part (accessed )
- A2A Protocol Specification, Appendix A.2.1: Kind Discriminator Removed (accessed )
- A2A Protocol Specification, section 3.7: Messages and Artifacts (accessed )
- A2A Protocol Specification, section 14.1.1: application/a2a+json (security considerations) (accessed )