Skip to main content
Glama

list_agent_tools

Retrieve available tools for a specific agent in the Letta system to manage agent capabilities and tool assignments.

Instructions

List all tools available for a specific agent. Use attach_tool to add more tools or list_mcp_tools_by_server to discover available tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesID of the agent to list tools for

Implementation Reference

  • The main handler function that implements the list_agent_tools tool logic: validates agent_id, fetches agent information via API, extracts tools, and returns a formatted JSON response.
    export async function handleListAgentTools(server, args) { try { if (!args.agent_id) { throw new Error('Missing required argument: agent_id'); } const headers = server.getApiHeaders(); const agentInfoResponse = await server.api.get(`/agents/${args.agent_id}`, { headers }); const agentName = agentInfoResponse.data.name; const tools = agentInfoResponse.data.tools || []; return { content: [ { type: 'text', text: JSON.stringify({ agent_id: args.agent_id, agent_name: agentName, tool_count: tools.length, tools: tools, }), }, ], }; } catch (error) { server.createErrorResponse(error); } }
  • The tool definition object including name, description, and inputSchema for validation.
    export const listAgentToolsDefinition = { name: 'list_agent_tools', description: 'List all tools available for a specific agent. Use attach_tool to add more tools or list_mcp_tools_by_server to discover available tools.', inputSchema: { type: 'object', properties: { agent_id: { type: 'string', description: 'ID of the agent to list tools for', }, }, required: ['agent_id'], }, };
  • Registration of the tool handler in the main switch statement within the CallToolRequestSchema handler.
    case 'list_agent_tools': return handleListAgentTools(server, request.params.arguments);
  • Inclusion of the tool definition in the allTools array used for ListToolsRequestSchema.
    listAgentToolsDefinition,

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/oculairmedia/Letta-MCP-server'

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