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
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | ID 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'], }, };
- src/tools/index.js:157-158 (registration)Registration of the tool handler in the main switch statement within the CallToolRequestSchema handler.case 'list_agent_tools': return handleListAgentTools(server, request.params.arguments);
- src/tools/index.js:106-106 (registration)Inclusion of the tool definition in the allTools array used for ListToolsRequestSchema.listAgentToolsDefinition,