Skip to main content
Glama

deleteMemo

Remove a specific memo by its ID from the memo-mcp server, which supports recording, searching, and retrieving memos using a LowDB local database.

Instructions

Delete a memo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the memo

Implementation Reference

  • The MCP tool handler for 'deleteMemo'. It calls the repository's deleteMemo function, handles the case where the memo is not found, and returns structured content with the deleted memo or an error.
    async ({ id }) => { const deletedMemo = await deleteMemo(id) if (!deletedMemo) { return { content: [{ text: "Memo not found", type: "text" }], isError: true, } } return { content: [{ text: JSON.stringify(deletedMemo), type: "text" }], structuredContent: { memo: deletedMemo }, } },
  • Registration of the 'deleteMemo' MCP tool, including input/output schemas and the handler function.
    server.registerTool( "deleteMemo", { description: "Delete a memo", inputSchema: { id: z.string().describe("The ID of the memo"), }, outputSchema: { memo: MemoSchema }, title: "Delete Memo", }, async ({ id }) => { const deletedMemo = await deleteMemo(id) if (!deletedMemo) { return { content: [{ text: "Memo not found", type: "text" }], isError: true, } } return { content: [{ text: JSON.stringify(deletedMemo), type: "text" }], structuredContent: { memo: deletedMemo }, } },
  • Inline schema definition for the deleteMemo tool's input (id: string) and output (memo: MemoSchema).
    { description: "Delete a memo", inputSchema: { id: z.string().describe("The ID of the memo"), }, outputSchema: { memo: MemoSchema }, title: "Delete Memo", },
  • Repository helper function that performs the actual deletion: reads DB, finds and removes the memo by ID, writes DB, returns the deleted memo.
    export const deleteMemo = async (id: string) => { await db.read() const index = db.data.memos.findIndex((memo) => memo.id === id) if (index == -1) { return undefined } const [deletedMemo] = db.data.memos.splice(index, 1) await db.write() return deletedMemo }

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