ToolLoopAgent and optionally accepts for payment gating and capabilities for A2A agent card configuration.
app/agent.ts
Exports
| Export | Type | Required | Description |
|---|---|---|---|
default | ToolLoopAgent | Yes | The agent instance |
accepts | Accepts | No | Payment config — gates the A2A /agent route |
capabilities | Capabilities | No | A2A capabilities — controls streaming and push notification support |
accepts is exported, the /agent endpoint requires x402 payment. Without it, the agent is not registered on the A2A endpoint. accepts can also be an array of payment entries for multi-network support.
Capabilities
The optionalcapabilities export controls the A2A agent card’s capabilities field and the executor’s behavior:
| Field | Type | Default | Description |
|---|---|---|---|
streaming | boolean | true | Whether the agent streams responses via textStream |
pushNotifications | boolean | false | Whether the agent supports push notifications |
stateTransitionHistory | boolean | undefined | Whether the agent exposes state transition history |
streaming is set to false, the executor uses agent.generate() instead of agent.stream(), returning the full response as a single artifact rather than streaming chunks. This is useful for agents backed by models or APIs that don’t support streaming.