Skip to main content
Glama

get_agent_summary

Retrieve a concise summary of an agent's configuration, including core memory snippets and attached tools/sources, to understand current settings before making modifications.

Instructions

Provides a concise summary of an agent's configuration, including core memory snippets and attached tool/source names. Use list_agents to find agent IDs. Follow up with modify_agent to change settings or attach_tool to add capabilities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesThe ID of the agent to summarize.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
modelNo
toolsNo
agent_idYes
descriptionNo
last_activityNo
memory_summaryNo

Implementation Reference

  • The core handler function that implements the get_agent_summary tool logic. It fetches agent state, core memory blocks, attached tools, and sources from the Letta API endpoints concurrently and compiles them into a structured JSON summary returned as tool content.
    export async function handleGetAgentSummary(server, args) {
        if (!args?.agent_id) {
            server.createErrorResponse('Missing required argument: agent_id');
        }
    
        const agentId = args.agent_id;
        const encodedAgentId = encodeURIComponent(agentId);
        const headers = server.getApiHeaders();
    
        try {
            logger.info(`Fetching summary for agent ${agentId}...`);
    
            // Fetch data from multiple endpoints concurrently
            const [agentStateRes, coreMemoryRes, toolsRes, sourcesRes] = await Promise.allSettled([
                server.api.get(`/agents/${encodedAgentId}`, { headers }),
                server.api.get(`/agents/${encodedAgentId}/core-memory/blocks`, { headers }),
                server.api.get(`/agents/${encodedAgentId}/tools`, { headers }),
                server.api.get(`/agents/${encodedAgentId}/sources`, { headers }),
            ]);
    
            // Process Agent State
            if (agentStateRes.status === 'rejected' || agentStateRes.value.status !== 200) {
                const errorInfo =
                    agentStateRes.reason?.response?.data ||
                    agentStateRes.reason?.message ||
                    agentStateRes.value?.data ||
                    'Unknown error fetching agent state';
                logger.error(`Failed to fetch agent state for ${agentId}:`, errorInfo);
                // If agent doesn't exist, return a specific error
                if (
                    agentStateRes.reason?.response?.status === 404 ||
                    agentStateRes.value?.status === 404
                ) {
                    server.createErrorResponse(`Agent not found: ${agentId}`);
                }
                server.createErrorResponse(`Failed to fetch agent state: ${JSON.stringify(errorInfo)}`);
            }
            const agentState = agentStateRes.value.data;
    
            // Process Core Memory (optional, might fail if agent has none)
            let coreMemoryBlocks = [];
            if (coreMemoryRes.status === 'fulfilled' && coreMemoryRes.value.status === 200) {
                coreMemoryBlocks = coreMemoryRes.value.data.map((block) => ({
                    label: block.label,
                    value_snippet:
                        block.value.substring(0, 100) + (block.value.length > 100 ? '...' : ''),
                }));
            } else {
                logger.warn(
                    `Could not fetch core memory for ${agentId}:`,
                    coreMemoryRes.reason?.response?.data ||
                        coreMemoryRes.reason?.message ||
                        'Non-200 status',
                );
            }
    
            // Process Tools (optional)
            let attachedTools = [];
            if (toolsRes.status === 'fulfilled' && toolsRes.value.status === 200) {
                attachedTools = toolsRes.value.data.map((tool) => ({
                    id: tool.id,
                    name: tool.name,
                    type: tool.tool_type,
                }));
            } else {
                logger.warn(
                    `Could not fetch tools for ${agentId}:`,
                    toolsRes.reason?.response?.data || toolsRes.reason?.message || 'Non-200 status',
                );
            }
    
            // Process Sources (optional)
            let attachedSources = [];
            if (sourcesRes.status === 'fulfilled' && sourcesRes.value.status === 200) {
                attachedSources = sourcesRes.value.data.map((source) => ({
                    id: source.id,
                    name: source.name,
                }));
            } else {
                logger.warn(
                    `Could not fetch sources for ${agentId}:`,
                    sourcesRes.reason?.response?.data || sourcesRes.reason?.message || 'Non-200 status',
                );
            }
    
            // Construct the summary
            const summary = {
                agent_id: agentState.id,
                name: agentState.name,
                description: agentState.description,
                system_prompt_snippet:
                    agentState.system.substring(0, 200) + (agentState.system.length > 200 ? '...' : ''),
                llm_config:
                    agentState.llm_config?.handle ||
                    `${agentState.llm_config?.model_endpoint_type}/${agentState.llm_config?.model}`,
                embedding_config:
                    agentState.embedding_config?.handle ||
                    `${agentState.embedding_config?.embedding_endpoint_type}/${agentState.embedding_config?.embedding_model}`,
                core_memory_blocks: coreMemoryBlocks,
                attached_tools_count: attachedTools.length,
                attached_tools: attachedTools,
                attached_sources_count: attachedSources.length,
                attached_sources: attachedSources,
            };
    
            return {
                content: [
                    {
                        type: 'text',
                        text: JSON.stringify(summary),
                    },
                ],
            };
        } catch (error) {
            // Catch any unexpected errors during processing
            logger.error(`Unexpected error for agent ${agentId}:`, error);
            server.createErrorResponse(`Failed to get agent summary: ${error.message}`);
        }
    }
  • The tool definition object including name, description, and inputSchema requiring 'agent_id'.
    export const getAgentSummaryDefinition = {
        name: 'get_agent_summary',
        description:
            "Provides a concise summary of an agent's configuration, including core memory snippets and attached tool/source names. Use list_agents to find agent IDs. Follow up with modify_agent to change settings or attach_tool to add capabilities.",
        inputSchema: {
            type: 'object',
            properties: {
                agent_id: {
                    type: 'string',
                    description: 'The ID of the agent to summarize.',
                },
            },
            required: ['agent_id'],
        },
    };
  • The switch case in the main CallToolRequestSchema handler that dispatches 'get_agent_summary' calls to handleGetAgentSummary.
    case 'get_agent_summary':
        return handleGetAgentSummary(server, request.params.arguments);
  • Import of the handler and definition from the implementation file.
    import { handleGetAgentSummary, getAgentSummaryDefinition } from './agents/get-agent-summary.js';
  • Inclusion of getAgentSummaryDefinition in the allTools array for registration with the MCP server.
    getAgentSummaryDefinition,
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations are not provided, so the description carries full burden. It mentions 'concise summary' and includes 'core memory snippets and attached tool/source names', which adds context about what information is returned. However, it lacks details on permissions, rate limits, or error handling. With no annotations, this is a moderate disclosure but could be more comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by two concise guidance sentences. Every sentence earns its place by providing essential usage information without redundancy, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which covers return values), one parameter with full schema coverage, and no annotations, the description is mostly complete. It explains the purpose, usage guidelines, and what information is included in the summary. However, it could improve by adding more behavioral context (e.g., error cases or limitations) to fully compensate for the lack of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the schema fully documenting the single parameter 'agent_id'. The description does not add any parameter-specific information beyond what's in the schema. According to the rules, with high schema coverage (>80%), the baseline is 3, as the description doesn't need to compensate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Provides a concise summary') and resources ('agent's configuration, including core memory snippets and attached tool/source names'). It distinguishes from siblings like list_agents (which finds IDs) and retrieve_agent (which might have different scope), making the purpose specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides usage guidelines: 'Use list_agents to find agent IDs' for prerequisites and 'Follow up with modify_agent to change settings or attach_tool to add capabilities' for next steps. This gives clear when-to-use context and names alternatives, helping the agent select this tool appropriately.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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