AGUI.Abstractions Types
AGUI.Abstractions contains the protocol model shared by AG-UI .NET clients
and servers. The JSON wire names are camel-case and match the AG-UI protocol.
RunAgentInput
RunAgentInput is the request payload for running an agent. In the HTTP API, it
is the body of the POST request.
| C# property | JSON field | Type | Description |
|---|---|---|---|
ThreadId | threadId | string | ID of the conversation thread |
RunId | runId | string | ID of the current run |
ParentRunId | parentRunId | string? | Optional lineage pointer for branching or time travel |
Messages | messages | IList<AGUIMessage> | Conversation messages |
Tools | tools | IList<AGUITool>? | Tools available to the agent |
State | state | JsonElement? | Current frontend or agent state |
Resume | resume | IList<AGUIResume>? | Resume payloads for interrupted runs |
Context | context | IList<AGUIContext>? | Context objects provided to the agent |
ForwardedProperties | forwardedProps | JsonElement | Additional properties forwarded by the client |
Message Types
Messages form a closed hierarchy rooted atAGUIMessage. The base type carries
only the fields shared by every role: Id and Role. Role-specific properties
such as content, name, encryptedValue, toolCalls, and toolCallId are
declared on the sealed role classes.
Roles
TheRole property returns one of the lowercase constants in AGUIRoles:
| Constant | JSON value |
|---|---|
AGUIRoles.Developer | developer |
AGUIRoles.System | system |
AGUIRoles.Assistant | assistant |
AGUIRoles.User | user |
AGUIRoles.Tool | tool |
AGUIRoles.Activity | activity |
AGUIRoles.Reasoning | reasoning |
AGUIDeveloperMessage
| C# property | JSON field | Type | Description |
|---|---|---|---|
Id | id | string? | Message ID |
Role | role | "developer" | Fixed role discriminator |
Content | content | string | Developer instruction content |
Name | name | string? | Optional sender name |
EncryptedValue | encryptedValue | string? | Optional opaque encrypted value |
AGUISystemMessage
| C# property | JSON field | Type | Description |
|---|---|---|---|
Id | id | string? | Message ID |
Role | role | "system" | Fixed role discriminator |
Content | content | string | System instruction content |
Name | name | string? | Optional sender name |
EncryptedValue | encryptedValue | string? | Optional opaque encrypted value |
AGUIAssistantMessage
| C# property | JSON field | Type | Description |
|---|---|---|---|
Id | id | string? | Message ID |
Role | role | "assistant" | Fixed role discriminator |
Content | content | string? | Optional assistant text |
Name | name | string? | Optional assistant name |
EncryptedValue | encryptedValue | string? | Optional opaque encrypted value |
ToolCalls | toolCalls | IList<AGUIToolCall>? | Tool calls made in the message |
AGUIUserMessage
AGUIUserMessage.Content is an AGUIUserContent value. It models the AG-UI
wire union string | InputContent[].
AGUIUserContent supports implicit conversions from string,
List<AGUIInputContent>, and AGUIInputContent[]. It also has a collection
builder, so C# collection expressions work. For reading, it implements
IReadOnlyList<AGUIInputContent>; a plain string is exposed as one
AGUITextInputContent part.
| C# property | JSON field | Type | Description |
|---|---|---|---|
Id | id | string? | Message ID |
Role | role | "user" | Fixed role discriminator |
Content | content | AGUIUserContent | Plain text or ordered multimodal parts |
Name | name | string? | Optional user name |
EncryptedValue | encryptedValue | string? | Optional opaque encrypted value |
AGUIInputContent hierarchy.
AGUIToolMessage
| C# property | JSON field | Type | Description |
|---|---|---|---|
Id | id | string? | Message ID |
Role | role | "tool" | Fixed role discriminator |
Content | content | string | Tool result content |
ToolCallId | toolCallId | string | ID of the tool call this message answers |
Error | error | string? | Optional error message |
EncryptedValue | encryptedValue | string? | Optional opaque encrypted value |
AGUIActivityMessage
| C# property | JSON field | Type | Description |
|---|---|---|---|
Id | id | string? | Message ID |
Role | role | "activity" | Fixed role discriminator |
ActivityType | activityType | string | Activity discriminator for renderer selection |
Content | content | JsonElement | Structured activity payload |
AGUIReasoningMessage
| C# property | JSON field | Type | Description |
|---|---|---|---|
Id | id | string? | Message ID |
Role | role | "reasoning" | Fixed role discriminator |
Content | content | string | Reasoning text |
EncryptedValue | encryptedValue | string? | Optional opaque encrypted value |
AGUIToolCall
| C# property | JSON field | Type | Description |
|---|---|---|---|
Id | id | string | Tool call ID |
Type | type | string | Tool call type; defaults to "function" |
Function | function | AGUIToolCallFunction | Function name and JSON-encoded arguments |
EncryptedValue | encryptedValue | string? | Optional opaque encrypted value |
AGUIToolCallFunction has Name (name) and Arguments (arguments).
Context
AGUIContext represents a piece of contextual information provided to an agent.
| C# property | JSON field | Type | Description |
|---|---|---|---|
Description | description | string | Description of what the context represents |
Value | value | string | Context value |
Tool
AGUITool defines a tool that an agent can call.
| C# property | JSON field | Type | Description |
|---|---|---|---|
Name | name | string | Tool name |
Description | description | string? | Optional tool description |
Parameters | parameters | JsonElement | JSON Schema for the tool parameters |
Metadata | metadata | JsonElement? | Optional arbitrary tool metadata |
State
State is represented asJsonElement? on RunAgentInput.State and as
JsonElement payloads in StateSnapshotEvent and StateDeltaEvent.
AgentCapabilities
AgentCapabilities is a structured declaration that an agent can expose so
clients can discover what it supports. All fields are optional.
| C# property | JSON field | Type | Description |
|---|---|---|---|
Identity | identity | IdentityCapabilities? | Agent identity and metadata |
Transport | transport | TransportCapabilities? | Streaming, websocket, binary, push, and resumability support |
Tools | tools | ToolsCapabilities? | Tool support and tool-calling configuration |
Output | output | OutputCapabilities? | Structured output and supported MIME types |
State | state | StateCapabilities? | Snapshot, delta, memory, and persistence support |
MultiAgent | multiAgent | MultiAgentCapabilities? | Delegation, handoffs, and sub-agent information |
Reasoning | reasoning | ReasoningCapabilities? | Reasoning, streaming, and encrypted reasoning support |
Multimodal | multimodal | MultimodalCapabilities? | Multimodal input and output support |
Execution | execution | ExecutionCapabilities? | Code execution and iteration/time limits |
HumanInTheLoop | humanInTheLoop | HumanInTheLoopCapabilities? | Approvals, interventions, feedback, interrupts, and approve-with-edits |
Custom | custom | IDictionary<string, object?>? | Integration-specific capabilities |
Serialization
All protocol types are registered inAGUIJsonSerializerContext, a
source-generated JsonSerializerContext. Use it when serializing protocol
types in AOT-sensitive code.