Content blocks represent displayable information in the Agent Client Protocol.
They provide a structured way to handle various types of user-facing content—whether it's text from language models, images for analysis, or embedded resources for context.
Content blocks appear in:
session/prompt
session/update
notificationsThis structure is compatible with the Model Context Protocol (MCP), enabling agents to seamlessly forward content from MCP tool outputs without transformation.
See protocol docs: Content
The new content after modification.
Optional
oldText?: string | nullThe original content (None for new files).
The file path being modified.
Content produced by a tool call.
Tool calls can produce different types of content including standard content blocks (text, images) or file diffs.
See protocol docs: Content