Skip to main content
Glama

Agentic Tools MCP Server

get.ts•1.89 kB
import { z } from 'zod'; import { MemoryStorage } from '../../storage/storage.js'; /** * Get a specific memory by ID * * @param storage - Memory storage instance * @returns MCP tool handler for getting memories */ export function createGetMemoryTool(storage: MemoryStorage) { return { name: 'get_memory', description: 'Get a specific memory by its ID', inputSchema: { id: z.string() }, handler: async ({ id }: { id: string }) => { try { // Validate inputs if (!id || id.trim().length === 0) { return { content: [{ type: 'text' as const, text: 'Error: Memory ID is required.' }], isError: true }; } const memory = await storage.getMemory(id.trim()); if (!memory) { return { content: [{ type: 'text' as const, text: `āŒ Memory not found. **Memory ID:** ${id} The memory with this ID does not exist or may have been deleted.` }], isError: true }; } return { content: [{ type: 'text' as const, text: `šŸ“‹ Memory Details: **Memory ID:** ${memory.id} **Title:** ${memory.title} **Content:** ${memory.content} **Category:** ${memory.category || 'Not specified'} **Created:** ${new Date(memory.createdAt).toLocaleString()} **Updated:** ${new Date(memory.updatedAt).toLocaleString()} **Metadata:** ${Object.keys(memory.metadata).length > 0 ? JSON.stringify(memory.metadata, null, 2) : 'None'}` }] }; } catch (error) { return { content: [{ type: 'text' as const, text: `Error retrieving memory: ${error instanceof Error ? error.message : 'Unknown error'}` }], isError: true }; } } }; }

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/Pimzino/agentic-tools-mcp'

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