Skip to main content
Glama

agent_get_tools

Retrieve the list of available tools for the current agent to enable access to persistent knowledge storage, memory management, and structured data capabilities.

Instructions

Get available tools for current agent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the agent_get_tools MCP tool. Retrieves the active agent using AgentManager and calls getAgentTools to return the agent's available tools and default tools.
    case 'agent_get_tools': { await am.initialize(); const activeAgent = am.getActiveAgent(); if (!activeAgent) { return { content: [ { type: 'text', text: 'No agent active. Activate an agent first to see available tools.' } ] }; } const tools = getAgentTools(activeAgent.id); return { content: [ { type: 'text', text: JSON.stringify({ agent: activeAgent.name, tools: tools?.tools || [], defaultTools: tools?.defaultTools || [] }, null, 2) } ] }; }
  • Input schema definition for the agent_get_tools tool, registered in the tools list returned by ListToolsRequestHandler.
    { name: 'agent_get_tools', description: 'Get available tools for current agent', inputSchema: { type: 'object', properties: {} } },
  • Core helper function getAgentTools that returns the AgentToolset for a given agent ID from the predefined AGENT_TOOLSETS.
    // Function to get tools for an agent export function getAgentTools(agentId: string): AgentToolset | undefined { return AGENT_TOOLSETS[agentId]; }
  • Type definition for AgentToolset, which structures the tools data returned by agent_get_tools.
    export interface AgentToolset { agentId: string; tools: AgentTool[]; defaultTools: string[]; // Tool IDs that are auto-enabled restrictions?: string[]; }
  • src/index.ts:423-425 (registration)
    Registration of ListToolsRequestHandler that returns the full tools list including agent_get_tools schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });

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