Skip to main content
Glama
108yen
by 108yen

Get Category

getCategory

Retrieve a specific category from the memo-mcp server by providing its unique ID, enabling organized access to stored memo categories.

Instructions

Get a single category by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the category

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes

Implementation Reference

  • The MCP tool handler for 'getCategory'. Fetches the category by ID from the repository, handles 'not found' case with error response, and returns formatted text content and structured category data.
    async ({ id }) => {
      const category = await getCategory(id)
      if (!category) {
        return {
          content: [{ text: "Category not found", type: "text" }],
          isError: true,
        }
      }
    
      return {
        content: [{ text: JSON.stringify(category), type: "text" }],
        structuredContent: { category },
      }
    },
  • Registers the 'getCategory' MCP tool, providing description, input schema (id: string), output schema referencing CategorySchema, and title.
    server.registerTool(
      "getCategory",
      {
        description: "Get a single category by ID",
        inputSchema: {
          id: z.string().describe("The ID of the category"),
        },
        outputSchema: { category: CategorySchema },
        title: "Get Category",
      },
  • Zod schema definition for Category type, used in tool outputSchema and throughout the codebase for validation and typing.
    export const CategorySchema = z.object({
      createdAt: z.string().datetime(),
      id: z.string(),
      name: z.string().min(1),
      updatedAt: z.string().datetime(),
    })
  • Repository helper function that reads the database and finds a category by its ID.
    export const getCategory = async (
      id: string,
    ): Promise<Category | undefined> => {
      await db.read()
      return db.data.categories.find((c) => c.id === id)
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves a category but doesn't mention whether it's a read-only operation, what happens if the ID doesn't exist (e.g., returns null or error), authentication requirements, or rate limits. This leaves significant gaps in understanding the tool's behavior.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core functionality, making it easy for an agent to parse quickly. Every word earns its place in this minimal yet clear formulation.

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?

Given the simple nature (single parameter, read operation implied by 'Get'), the presence of an output schema (which handles return values), and high schema coverage, the description is minimally adequate. However, it lacks context about error handling, permissions, or integration with sibling tools, which could improve completeness for agent use.

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 has 100% description coverage, with the 'id' parameter clearly documented. The description adds no additional semantic context beyond what the schema provides (e.g., format examples, validation rules, or relationship to other tools). This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

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

Purpose4/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 resource ('a single category by ID'), making the purpose immediately understandable. It distinguishes from sibling 'getCategories' by specifying retrieval of a single item rather than a list. However, it doesn't fully differentiate from 'searchMemos' which might also retrieve categories indirectly, keeping it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'getCategories' for multiple categories or 'searchMemos' for broader searches. It lacks any mention of prerequisites, error conditions, or contextual usage scenarios, leaving the agent with minimal direction.

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