Skip to main content
Glama

agent_get_active

Retrieve the currently active AI agent from persistent memory storage to maintain context across sessions.

Instructions

Get the currently active agent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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: {} } },
  • Input schema for agent_get_active tool: accepts an empty object (no parameters).
    inputSchema: { type: 'object', properties: {} }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hlsitechio/mcp-instruct'

If you have feedback or need assistance with the MCP directory API, please join our Discord server