Skip to main content
Glama
108yen
by 108yen

Search Memos

searchMemos

Search memos by keyword, date range, or category to locate specific entries.

Instructions

Search memos by keyword and date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryIdNo
endNoEnd date for the search range use ISO 8601 format. ex: 2020-02-01T00:00:00+09:00
queryNo
startNoStart date for the search range use ISO 8601 format. ex: 2020-01-01T00:00:00+09:00

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
memosYes

Implementation Reference

  • The core handler logic. Filters memos by query string (title/content), categoryId, and date range (start/end).
    export const searchMemos = async (params: SearchMemosParams) => {
      const { categoryId, end, query, start } = params
      await db.read()
    
      return db.data.memos.filter((memo) => {
        if (query && !memo.content.includes(query) && !memo.title.includes(query)) {
          return false
        }
    
        if (categoryId && memo.categoryId !== categoryId) {
          return false
        }
    
        const updatedAt = new Date(memo.updatedAt).getTime()
    
        if (start && updatedAt < start.getTime()) {
          return false
        }
        if (end && updatedAt > end.getTime()) {
          return false
        }
        return true
      })
    }
  • Zod schema for searchMemos input: optional query (string), categoryId (string), start/end (ISO 8601 datetime strings transformed to Date).
    export const SearchMemosSchema = z.object({
      categoryId: z.string().optional(),
      end: z
        .string()
        .datetime({
          message: "Invalid date format. Please use ISO 8601 format.",
          offset: true,
        })
        .transform((date) => new Date(date))
        .optional()
        .describe(
          "End date for the search range use ISO 8601 format. ex: 2020-02-01T00:00:00+09:00",
        ),
      query: z.string().optional(),
      start: z
        .string()
        .datetime({
          message: "Invalid date format. Please use ISO 8601 format.",
          offset: true,
        })
        .transform((date) => new Date(date))
        .optional()
        .describe(
          "Start date for the search range use ISO 8601 format. ex: 2020-01-01T00:00:00+09:00",
        ),
    })
    
    export type SearchMemosParams = z.infer<typeof SearchMemosSchema>
  • Registration of the 'searchMemos' tool on the MCP server via registerTool(), with schema references and handler.
    server.registerTool(
      "searchMemos",
      {
        description: "Search memos by keyword and date range",
        inputSchema: SearchMemosSchema.shape,
        outputSchema: { memos: z.array(MemoSchema) },
        title: "Search Memos",
      },
      async (params) => {
        const memos = await searchMemos(params)
        return {
          content: [{ text: JSON.stringify(memos), type: "text" }],
          structuredContent: { memos },
        }
      },
    )
Behavior2/5

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

No annotations provided, and the description omits behavioral details such as pagination, ordering, required permissions, or performance implications. The one-line description is insufficient.

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 extremely concise (6 words) and front-loaded with key information. No extraneous content.

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

Completeness3/5

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

For a search tool with 4 parameters and an output schema, the description is minimal. It lacks details on output structure, sorting, or limits, but for simple keyword/date searches it may suffice.

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?

Schema coverage is 50% (only start/end have descriptions). The description mentions 'keyword and date range', covering query and the temporal params, but categoryId is omitted. The description adds partial value beyond the schema.

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 verb 'search' and the resource 'memos', with specific criteria (keyword and date range). This distinguishes it from siblings like getMemos or getMemo.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like getMemos or filtering manually. Without such context, an agent may misuse it.

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