get_agent_state
Retrieve the complete state of an AI agent, including its CLI session ID, to enable resuming or monitoring agent operations within the terminal multiplexer environment.
Instructions
Get the full state of an agent including cli_session_id for resume.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent ID |
Implementation Reference
- src/agent-engine.ts:531-533 (handler)The engine method that implements the logic to retrieve the agent's state from the registry.
getAgentState(agentId: string): AgentRecord | null { return this.registry.get(agentId); } - src/server.ts:779-790 (registration)The MCP tool registration and handler wrapper for get_agent_state.
server.tool( "get_agent_state", "Get the full state of an agent including cli_session_id for resume.", { agent_id: z.string().describe("Agent ID"), }, async (args) => { try { const state = engine.getAgentState(args.agent_id); if (!state) return err(new Error(`Agent not found: ${args.agent_id}`)); return ok(state as unknown as Record<string, unknown>);