Skip to main content
Glama

search_memories

Search stored memories by content or category using natural language queries. Automatically triggered by phrases like 'find in memories' or 'look for' to retrieve relevant information.

Instructions

IMPORTANT: This tool should be automatically called when users say "찾아", "검색", "기억 중에", "search memory", "find in memories", "look for" or similar keywords. Search memories by content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoCategory to search in
queryYesSearch query

Implementation Reference

  • Executes the core logic of the search_memories tool by querying the MemoryManager and formatting results.
    export async function searchMemoriesHandler(args: { query: string; category?: string }): Promise<ToolResult> { const { query, category: searchCategory } = args; try { const mm = MemoryManager.getInstance(); const results = mm.search(query); const resultList = results.map(m => `• ${m.key} (${m.category}): ${m.value.substring(0, 100)}${m.value.length > 100 ? '...' : ''}` ).join('\n'); return { content: [{ type: 'text', text: `✓ Found ${results.length} matches for "${query}":\n${resultList || 'None'}` }] }; } catch (error) { return { content: [{ type: 'text', text: `✗ Error: ${error instanceof Error ? error.message : 'Unknown error'}` }] }; } }
  • Input/output schema and metadata definition for the search_memories tool.
    export const searchMemoriesDefinition: ToolDefinition = { name: 'search_memories', description: '찾아|검색|기억 중에|search|find|look for - Search memories by content', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query' }, category: { type: 'string', description: 'Category to search in' } }, required: ['query'] }, annotations: { title: 'Search Memories', audience: ['user', 'assistant'] } };
  • src/index.ts:169-170 (registration)
    Registration in the main switch dispatcher for handling CallTool requests for search_memories.
    case 'search_memories': return await searchMemoriesHandler(args as any) as CallToolResult;
  • src/index.ts:77-77 (registration)
    Inclusion of the tool definition in the tools array for ListTools requests.
    searchMemoriesDefinition,

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/su-record/hi-ai'

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