Skip to main content
Glama

createMemo

Create and store structured memos with assigned titles, content, and categories for easy organization and retrieval in the MCP server memo-mcp.

Instructions

Create a new memo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryIdNo
contentYes
titleYes

Implementation Reference

  • Registration of the MCP tool named 'createMemo', including input/output schemas and the handler function that delegates to the repository implementation.
    server.registerTool( "createMemo", { description: "Create a new memo", inputSchema: CreateMemoSchema.shape, outputSchema: { memo: MemoSchema }, title: "Create Memo", }, async (memo) => { const newMemo = await createMemo(memo) return { content: [{ text: JSON.stringify(newMemo), type: "text" }], structuredContent: { memo: newMemo }, } }, )
  • Zod schema definition for the input parameters of the createMemo tool (CreateMemoSchema).
    export const CreateMemoSchema = z.object({ categoryId: z.string().optional(), content: z.string(), title: z.string(), }) export type CreateMemo = z.infer<typeof CreateMemoSchema>
  • Core handler function that implements the logic to create and persist a new memo to the database.
    export const createMemo = async (memo: CreateMemo) => { const now = new Date().toISOString() const newMemo = { ...memo, createdAt: now, id: nanoid(), updatedAt: now, } db.data.memos.push(newMemo) await db.write() return newMemo }
  • Output schema for the memo object returned by createMemo tool.
    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.", ), })

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