Skip to main content
Glama
108yen
by 108yen

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
NameRequiredDescriptionDefault
idYesThe ID of the memo

Implementation Reference

  • 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 },
      }
    },
  • 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.",
        ),
    })
  • 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",
      },
  • 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)
    }

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