getMemos
Retrieve all stored memos from the local database for review or analysis.
Instructions
Get all memos
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server/tools.ts:54-60 (handler)MCP tool handler that invokes the repository getMemos function and returns formatted content and structured memos data.async () => { const memos = await getMemos() return { content: [{ text: JSON.stringify(memos), type: "text" }], structuredContent: { memos }, } },
- src/schemas/memos.ts:3-22 (schema)Zod schema for Memo type, used in the getMemos tool's outputSchema as z.array(MemoSchema). Defines structure and validation for memo objects.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:46-61 (registration)Registration of the 'getMemos' tool on the MCP server, including description, empty input schema, MemoSchema-based output schema, title, and inline handler.server.registerTool( "getMemos", { description: "Get all memos", inputSchema: {}, outputSchema: { memos: z.array(MemoSchema) }, title: "Get Memos", }, async () => { const memos = await getMemos() return { content: [{ text: JSON.stringify(memos), type: "text" }], structuredContent: { memos }, } }, )
- src/repository/memos.ts:20-23 (helper)Repository utility function that reads the database and returns all memos. Invoked by the tool handler.export const getMemos = async () => { await db.read() return db.data.memos }