agent_get_active
Retrieve the currently active AI agent from persistent memory storage to maintain context across sessions.
Instructions
Get the currently active agent
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "agent_get_active"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:940-970 (handler)Handler for the 'agent_get_active' tool. Initializes the AgentManager if needed, retrieves the currently active agent using am.getActiveAgent(), and returns its details as JSON or a message if no agent is active.
case 'agent_get_active': { await am.initialize(); const activeAgent = am.getActiveAgent(); if (!activeAgent) { return { content: [ { type: 'text', text: 'No agent currently active. Use agent_activate to select one.' } ] }; } return { content: [ { type: 'text', text: JSON.stringify({ active: { id: activeAgent.id, name: activeAgent.name, category: activeAgent.metadata.category, role: activeAgent.metadata.role } }, null, 2) } ] }; } - src/index.ts:378-385 (registration)Registration of the 'agent_get_active' tool in the tools array, including its name, description, and empty input schema. This makes it available via listTools.
{ name: 'agent_get_active', description: 'Get the currently active agent', inputSchema: { type: 'object', properties: {} } }, - src/index.ts:381-384 (schema)Input schema for agent_get_active tool: accepts an empty object (no parameters).
inputSchema: { type: 'object', properties: {} }