Skip to main content
Glama

getMemo

Retrieve a specific memo by its unique ID from the memo-mcp server, enabling efficient access to stored information using a simple query.

Instructions

Get a single memo by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the memo

Implementation Reference

  • The handler function for the 'getMemo' tool. It takes an ID, fetches the memo using the repository function, handles not found case, and returns structured content in MCP format.
    async ({ id }) => { const memo = await getMemo(id) if (!memo) { return { content: [{ text: "Memo not found", type: "text" }], isError: true, } } return { content: [{ text: JSON.stringify(memo), type: "text" }], structuredContent: { memo }, } },
  • Registers the 'getMemo' tool with the MCP server, specifying name, description, input/output schemas, and the handler function.
    server.registerTool( "getMemo", { description: "Get a single memo by ID", inputSchema: { id: z.string().describe("The ID of the memo"), }, outputSchema: { memo: MemoSchema }, title: "Get Memo", }, async ({ id }) => { const memo = await getMemo(id) if (!memo) { return { content: [{ text: "Memo not found", type: "text" }], isError: true, } } return { content: [{ text: JSON.stringify(memo), type: "text" }], structuredContent: { memo }, } }, )
  • Repository function that retrieves a memo by ID from the database.
    export const getMemo = async (id: string) => { await db.read() return db.data.memos.find((memo) => memo.id === id) }
  • Zod schema definition for a Memo object, used in the output of the getMemo tool.
    export const MemoSchema = z.object({ categoryId: z.string().optional(), content: z.string(), createdAt: z .string() .datetime() .transform((date) => new Date(date)) .describe( "The date when the memo was created. Display in ISO 8601 format, UTC+0 timezone.", ), id: z.string(), title: z.string(), updatedAt: z .string() .datetime() .transform((date) => new Date(date)) .describe( "The date when the memo was last updated. Display in ISO 8601 format, UTC+0 timezone.", ), })

Other Tools

Related 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/108yen/memo-mcp'

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