Skip to main content
Glama
108yen
by 108yen

Update Category

updateCategory

Modify existing categories by updating their names or other properties using the category ID. This tool helps maintain organized memo structures in the memo-mcp server.

Instructions

Update a category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the category
nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes

Implementation Reference

  • Core handler function implementing the logic to update a category by ID: finds the category in the database, updates the name if provided, sets updatedAt, writes to DB, returns the updated category or undefined if not found.
    export const updateCategory = async (
      id: string,
      { name }: UpdateCategory,
    ): Promise<Category | undefined> => {
      await db.read()
      const index = db.data.categories.findIndex((c) => c.id === id)
      if (index === -1) {
        return undefined
      }
    
      const existingCategory = db.data.categories[index]
      if (!existingCategory) {
        return undefined
      }
    
      const newCategory: Category = {
        ...existingCategory,
        ...(name ? { name } : {}),
        updatedAt: new Date().toISOString(),
      }
      db.data.categories[index] = newCategory
      await db.write()
    
      return newCategory
    }
  • Zod schema definition for UpdateCategory input (optional name field) and corresponding TypeScript type.
    export const UpdateCategorySchema = z.object({
      name: z.string().min(1).optional(),
    })
    
    export type UpdateCategory = z.infer<typeof UpdateCategorySchema>
  • MCP tool registration for "updateCategory": defines input schema (id + UpdateCategory fields), output schema, description, and the handler function that calls the repository updateCategory and formats the response.
    server.registerTool(
      "updateCategory",
      {
        description: "Update a category",
        inputSchema: {
          id: z.string().describe("The ID of the category"),
          ...UpdateCategorySchema.shape,
        },
        outputSchema: { category: CategorySchema },
        title: "Update Category",
      },
      async ({ id, ...category }) => {
        const updatedCategory = await updateCategory(id, category)
        if (!updatedCategory) {
          return {
            content: [{ text: "Category not found", type: "text" }],
            isError: true,
          }
        }
    
        return {
          content: [{ text: JSON.stringify(updatedCategory), type: "text" }],
          structuredContent: { category: updatedCategory },
        }
      },
    )
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Update a category' implies a mutation operation but fails to specify critical details: required permissions, whether changes are reversible, error conditions (e.g., invalid ID), or response format. The presence of an output schema mitigates some gaps, but the description lacks essential behavioral context for a mutation tool.

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

Conciseness4/5

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

The description is extremely concise ('Update a category'), consisting of a single sentence with no wasted words. However, this brevity borders on under-specification rather than effective conciseness, as it omits necessary details. It is front-loaded but lacks substance, earning a 4 for efficiency despite its inadequacy.

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

Completeness2/5

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

Given the tool's mutation nature, lack of annotations, and incomplete parameter documentation (50% schema coverage), the description is insufficient. While an output schema exists, the description does not address behavioral aspects like side effects or error handling. For a tool with siblings and update functionality, more context is needed to guide proper 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?

Schema description coverage is 50% (only 'id' has a description), and the description adds no parameter information beyond what the schema provides. It does not explain the purpose of 'name' or clarify parameter interactions. With moderate schema coverage, the baseline is 3, as the description neither compensates for gaps nor adds meaningful semantics.

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

Purpose2/5

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

The description 'Update a category' is a tautology that merely restates the tool name/title without adding meaningful context. It specifies the verb ('Update') and resource ('category'), but lacks any detail about what aspects are updated or how this differs from sibling tools like 'updateMemo'. This minimal statement provides no differentiation from alternatives.

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

Usage Guidelines1/5

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

The description offers no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing an existing category ID), exclusions, or comparisons to sibling tools such as 'createCategory' or 'deleteCategory'. Without any usage context, the agent must infer when this tool is appropriate.

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