getMemo
Retrieve a specific memo from the memo-mcp server by providing its unique ID. This tool enables agents to access recorded information stored in the local database.
Instructions
Get a single memo by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the memo |
Implementation Reference
- src/server/tools.ts:73-86 (handler)MCP tool handler for getMemo: calls repository getMemo(id), handles not found case with error response, otherwise returns text and structured content with the 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 }, } },
- src/schemas/memos.ts:3-22 (schema)MemoSchema: Zod schema defining the memo object structure (id, title, content, optional categoryId, createdAt/updatedAt as Date), used in getMemo outputSchema.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.", ), })
- src/server/tools.ts:63-72 (registration)Registration of the getMemo tool using server.registerTool, specifying name, description, inputSchema (id: string), outputSchema ({memo: MemoSchema}), and title.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", },
- src/repository/memos.ts:25-28 (helper)Repository helper function getMemo: reads the database and finds/returns the memo by matching id.export const getMemo = async (id: string) => { await db.read() return db.data.memos.find((memo) => memo.id === id) }