Skip to main content
Glama
108yen
by 108yen

Delete Category

deleteCategory

Remove a category from the memo-mcp server by specifying its ID to organize your memo database.

Instructions

Delete a category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the category

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes

Implementation Reference

  • Core handler function for deleting a category by ID. Removes the category from the database, clears the categoryId from associated memos, and persists changes.
    export const deleteCategory = async (
      id: string,
    ): Promise<Category | undefined> => {
      await db.read()
      const index = db.data.categories.findIndex((c) => c.id === id)
      if (index === -1) {
        return undefined
      }
    
      const deletedCategory = db.data.categories.splice(index, 1)[0]
      db.data.memos.forEach((memo) => {
        if (memo.categoryId === id) {
          memo.categoryId = undefined
        }
      })
      await db.write()
    
      return deletedCategory
    }
  • Registers the 'deleteCategory' tool on the MCP server, defining its schema, description, and handler that wraps the repository function.
    server.registerTool(
      "deleteCategory",
      {
        description: "Delete a category",
        inputSchema: {
          id: z.string().describe("The ID of the category"),
        },
        outputSchema: { category: CategorySchema },
        title: "Delete Category",
      },
      async ({ id }) => {
        const deletedCategory = await deleteCategory(id)
        if (!deletedCategory) {
          return {
            content: [{ text: "Category not found", type: "text" }],
            isError: true,
          }
        }
    
        return {
          content: [{ text: JSON.stringify(deletedCategory), type: "text" }],
          structuredContent: { category: deletedCategory },
        }
      },
    )
  • Zod schema for Category type, used in the outputSchema of deleteCategory tool.
    export const CategorySchema = z.object({
      createdAt: z.string().datetime(),
      id: z.string(),
      name: z.string().min(1),
      updatedAt: z.string().datetime(),
    })
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 deletes a category, implying a destructive mutation, but lacks details on permissions required, whether deletion is permanent or reversible, error handling (e.g., if the ID doesn't exist), or side effects (e.g., impact on associated memos). This is a significant gap for a destructive tool.

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 with just three words ('Delete a category'), front-loading the core action and resource. There is no wasted language or redundancy, making it efficient and easy to parse, though this brevity contributes to gaps in other dimensions.

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 tool's destructive nature, lack of annotations, and presence of an output schema (which handles return values), the description is minimally adequate. It identifies the tool's purpose but fails to provide crucial context like usage guidelines or behavioral traits, leaving the agent under-informed for safe and effective use.

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

Parameters4/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 as 'The ID of the category'. The description doesn't add any parameter details beyond this, but with high schema coverage and only one parameter, the baseline is strong. A score of 4 reflects that the schema adequately handles parameter semantics without needing extra description.

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

Purpose3/5

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

The description 'Delete a category' clearly states the action (delete) and target resource (category), which is adequate. However, it doesn't distinguish this tool from other destructive operations like 'deleteMemo' or explain what constitutes a 'category' in this context, making it somewhat vague compared to siblings.

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 is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing category ID), exclusions (e.g., cannot delete categories with associated memos), or comparisons to sibling tools like 'updateCategory' or 'getCategory', leaving the agent without context for selection.

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