Skip to main content

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# propertyJSON fieldTypeDescription
ThreadIdthreadIdstringID of the conversation thread
RunIdrunIdstringID of the current run
ParentRunIdparentRunIdstring?Optional lineage pointer for branching or time travel
MessagesmessagesIList<AGUIMessage>Conversation messages
ToolstoolsIList<AGUITool>?Tools available to the agent
StatestateJsonElement?Current frontend or agent state
ResumeresumeIList<AGUIResume>?Resume payloads for interrupted runs
ContextcontextIList<AGUIContext>?Context objects provided to the agent
ForwardedPropertiesforwardedPropsJsonElementAdditional properties forwarded by the client

Message Types

Messages form a closed hierarchy rooted at AGUIMessage. 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

The Role property returns one of the lowercase constants in AGUIRoles:
ConstantJSON value
AGUIRoles.Developerdeveloper
AGUIRoles.Systemsystem
AGUIRoles.Assistantassistant
AGUIRoles.Useruser
AGUIRoles.Tooltool
AGUIRoles.Activityactivity
AGUIRoles.Reasoningreasoning

AGUIDeveloperMessage

C# propertyJSON fieldTypeDescription
Ididstring?Message ID
Rolerole"developer"Fixed role discriminator
ContentcontentstringDeveloper instruction content
Namenamestring?Optional sender name
EncryptedValueencryptedValuestring?Optional opaque encrypted value

AGUISystemMessage

C# propertyJSON fieldTypeDescription
Ididstring?Message ID
Rolerole"system"Fixed role discriminator
ContentcontentstringSystem instruction content
Namenamestring?Optional sender name
EncryptedValueencryptedValuestring?Optional opaque encrypted value

AGUIAssistantMessage

C# propertyJSON fieldTypeDescription
Ididstring?Message ID
Rolerole"assistant"Fixed role discriminator
Contentcontentstring?Optional assistant text
Namenamestring?Optional assistant name
EncryptedValueencryptedValuestring?Optional opaque encrypted value
ToolCallstoolCallsIList<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# propertyJSON fieldTypeDescription
Ididstring?Message ID
Rolerole"user"Fixed role discriminator
ContentcontentAGUIUserContentPlain text or ordered multimodal parts
Namenamestring?Optional user name
EncryptedValueencryptedValuestring?Optional opaque encrypted value
See Multimodal Inputs for the AGUIInputContent hierarchy.

AGUIToolMessage

C# propertyJSON fieldTypeDescription
Ididstring?Message ID
Rolerole"tool"Fixed role discriminator
ContentcontentstringTool result content
ToolCallIdtoolCallIdstringID of the tool call this message answers
Errorerrorstring?Optional error message
EncryptedValueencryptedValuestring?Optional opaque encrypted value

AGUIActivityMessage

C# propertyJSON fieldTypeDescription
Ididstring?Message ID
Rolerole"activity"Fixed role discriminator
ActivityTypeactivityTypestringActivity discriminator for renderer selection
ContentcontentJsonElementStructured activity payload

AGUIReasoningMessage

C# propertyJSON fieldTypeDescription
Ididstring?Message ID
Rolerole"reasoning"Fixed role discriminator
ContentcontentstringReasoning text
EncryptedValueencryptedValuestring?Optional opaque encrypted value

AGUIToolCall

C# propertyJSON fieldTypeDescription
IdidstringTool call ID
TypetypestringTool call type; defaults to "function"
FunctionfunctionAGUIToolCallFunctionFunction name and JSON-encoded arguments
EncryptedValueencryptedValuestring?Optional opaque encrypted value
AGUIToolCallFunction has Name (name) and Arguments (arguments).

Context

AGUIContext represents a piece of contextual information provided to an agent.
C# propertyJSON fieldTypeDescription
DescriptiondescriptionstringDescription of what the context represents
ValuevaluestringContext value

Tool

AGUITool defines a tool that an agent can call.
C# propertyJSON fieldTypeDescription
NamenamestringTool name
Descriptiondescriptionstring?Optional tool description
ParametersparametersJsonElementJSON Schema for the tool parameters
MetadatametadataJsonElement?Optional arbitrary tool metadata

State

State is represented as JsonElement? on RunAgentInput.State and as JsonElement payloads in StateSnapshotEvent and StateDeltaEvent.
The schema of the state is defined by the agent. The protocol only carries it.

AgentCapabilities

AgentCapabilities is a structured declaration that an agent can expose so clients can discover what it supports. All fields are optional.
C# propertyJSON fieldTypeDescription
IdentityidentityIdentityCapabilities?Agent identity and metadata
TransporttransportTransportCapabilities?Streaming, websocket, binary, push, and resumability support
ToolstoolsToolsCapabilities?Tool support and tool-calling configuration
OutputoutputOutputCapabilities?Structured output and supported MIME types
StatestateStateCapabilities?Snapshot, delta, memory, and persistence support
MultiAgentmultiAgentMultiAgentCapabilities?Delegation, handoffs, and sub-agent information
ReasoningreasoningReasoningCapabilities?Reasoning, streaming, and encrypted reasoning support
MultimodalmultimodalMultimodalCapabilities?Multimodal input and output support
ExecutionexecutionExecutionCapabilities?Code execution and iteration/time limits
HumanInTheLoophumanInTheLoopHumanInTheLoopCapabilities?Approvals, interventions, feedback, interrupts, and approve-with-edits
CustomcustomIDictionary<string, object?>?Integration-specific capabilities
See Capabilities for protocol-level concepts and usage patterns.

Serialization

All protocol types are registered in AGUIJsonSerializerContext, a source-generated JsonSerializerContext. Use it when serializing protocol types in AOT-sensitive code.