Session Tools
Session tools let an Agent inspect session state, fetch transcript snippets, send messages into another session, or spawn a bounded sub-agent run. For the product ownership model, read Agents, Sessions, And Tasks.Tool Names
sessions_listsessions_historysessions_sendsessions_spawn
Key Model
Common session keys:| Source | Shape |
|---|---|
| Main direct chat | main resolves to the current Agent main key |
| Direct chat | agent:<agentId>:direct:<peerId> or channel/account-scoped variants |
| Group/channel | full agent:<agentId>:<channel>:group:<id> or ...:channel:<id> key |
| Scheduled task | cron:<job.id> internally |
| Webhook | hook:<uuid> unless explicitly set |
| Node run | node-<nodeId> unless explicitly set |
global and unknown are reserved and are not listed. If legacy config uses
session.scope = "global", tools expose it as main.
sessions_list
Lists session rows.
Parameters:
kinds?: string[]limit?: numberactiveMinutes?: numbermessageLimit?: number
sessions_history
Fetches transcript messages for one session.
Parameters:
sessionKeylimit?: numberincludeTools?: boolean
sessionKey accepts main, a full session key, or a session id string that can
be resolved by the gateway. By default, tool-result messages are filtered out.
sessions_send
Sends a message into another session.
Parameters:
sessionKey?label?agentId?messagetimeoutSeconds?: number
sessionKey or label, not both. When label is used, agentId
can disambiguate same-name sessions if cross-agent policy allows it.
Behavior:
timeoutSeconds = 0: enqueue and return immediately.timeoutSeconds > 0: wait for completion or timeout through gatewayagent.wait.- inter-session messages are stored with
message.provenance.kind = "inter_session". - reply-back loops are bounded by
session.agentToAgent.maxPingPongTurns. - announce steps can reply
ANNOUNCE_SKIPto stay silent.
sessions_spawn
Spawns a sub-agent run in an isolated session and announces the result back to
the requester channel when delivery is available.
Parameters:
tasklabel?agentId?model?thinking?runTimeoutSeconds?timeoutSeconds?(back-compat alias forrunTimeoutSeconds)thread?runtime?mode?cleanup?
runtimeissubagentby default;acptargets an ACP harness runtime- allowed target Agents come from
agents.defaults.subagents.allowAgentsoragents.list[].subagents.allowAgents - sub-agent sessions use
agent:<agentId>:subagent:<uuid> - sub-agents do not receive session tools by default
- nested spawns are blocked unless the sub-agent depth policy explicitly allows them
- the tool returns
{ status: "accepted", runId, childSessionKey } - channel plugins may bind
thread=truespawns to thread routing when supported
Visibility
Session tools can be scoped:self: current session only.tree: current session plus sessions spawned by it.agent: any session for the current Agent.all: any session, subject to cross-agent policy.- sandboxed sessions clamp to the configured sandbox visibility.
Channel Session Commands
External channel chats expose a small command layer for the same model:Send Policy
Delivery can be blocked by channel/chat type:/send on, /send off, and
/send inherit commands.