getMemos
Retrieve all stored memos from the memo-mcp server to access recorded notes and information for quick reference and review.
Instructions
Get all memos
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server/tools.ts:54-60 (handler)The MCP tool handler function for 'getMemos' that calls the repository function and formats the response as MCP content.async () => { const memos = await getMemos() return { content: [{ text: JSON.stringify(memos), type: "text" }], structuredContent: { memos }, } },
- src/server/tools.ts:46-61 (registration)Registration of the 'getMemos' tool with the MCP server, including schema and 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/server/tools.ts:48-53 (schema)Input and output schema for the getMemos tool.{ description: "Get all memos", inputSchema: {}, outputSchema: { memos: z.array(MemoSchema) }, title: "Get Memos", },
- src/repository/memos.ts:20-23 (helper)Repository helper function that reads the database and returns all memos.export const getMemos = async () => { await db.read() return db.data.memos }
- src/schemas/memos.ts:3-22 (schema)Zod schema definition for a Memo object, used in the getMemos tool output schema.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.", ), })