Skip to main content
Glama
108yen
by 108yen

Get Memo

getMemo

Retrieve a single memo by providing its unique ID.

Instructions

Get a single memo by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the memo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
memoYes

Implementation Reference

  • Core handler for getMemo — retrieves a single memo by ID from the database. Returns the memo object or undefined if not found.
    export const getMemo = async (id: string) => {
      await db.read()
      return db.data.memos.find((memo) => memo.id === id)
    }
  • Registration of the 'getMemo' tool on the MCP server. Defines input schema (id string), output schema (MemoSchema), and the async handler that calls getMemo(id) and returns the result or an error if not found.
    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",
      },
      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 — the output/type definition for a memo object. Used as the output schema for the getMemo tool registration.
    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.",
        ),
    })
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description relies on the verb 'Get' to imply a read-only operation. It lacks details on error handling or edge cases, but the simplicity of the tool makes it adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no unnecessary words, delivering the essential information efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one required parameter, output schema exists), the description is fully sufficient for an agent to understand and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides 100% coverage for the 'id' parameter, so the description adds no additional meaning beyond the schema. Baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('a single memo') along with the method ('by ID'), distinguishing it from siblings like 'getMemos' and 'searchMemos'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a specific memo ID is known, but does not explicitly mention when to use alternative tools like 'getMemos' for listing or 'searchMemos' for filtering.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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