Skip to main content
Glama
108yen
by 108yen

Create Category

createCategory

Organize memos by creating new categories to group related information for easier retrieval and management.

Instructions

Create a new category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes

Implementation Reference

  • MCP tool handler function for 'createCategory' that calls the repository function and formats the MCP response.
    async (category) => {
      const newCategory = await createCategory(category)
      return {
        content: [{ text: JSON.stringify(newCategory), type: "text" }],
        structuredContent: { category: newCategory },
      }
    },
  • Zod schema defining the input structure for the createCategory tool.
    export const CreateCategorySchema = z.object({
      name: z.string().min(1),
    })
    
    export type CreateCategory = z.infer<typeof CreateCategorySchema>
  • Registration of the 'createCategory' tool with the MCP server, specifying schema, description, and handler.
    server.registerTool(
      "createCategory",
      {
        description: "Create a new category",
        inputSchema: CreateCategorySchema.shape,
        outputSchema: { category: CategorySchema },
        title: "Create Category",
      },
      async (category) => {
        const newCategory = await createCategory(category)
        return {
          content: [{ text: JSON.stringify(newCategory), type: "text" }],
          structuredContent: { category: newCategory },
        }
      },
    )
  • Repository function that performs the actual category creation logic using the database.
    export const createCategory = async (
      category: CreateCategory,
    ): Promise<Category> => {
      const now = new Date().toISOString()
    
      const newCategory: Category = {
        ...category,
        createdAt: now,
        id: nanoid(),
        updatedAt: now,
      }
      db.data.categories.push(newCategory)
      await db.write()
    
      return newCategory
    }
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 'Create a new category', implying a write operation, but doesn't address permissions, side effects (e.g., if duplicates are allowed), error conditions, or what the output contains. This is a significant gap for a mutation tool with zero annotation coverage.

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, front-loading the core action. There's no wasted language, making it efficient for quick scanning, 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 simplicity (1 parameter, no nested objects) and the presence of an output schema (which handles return values), the description is minimally adequate. However, as a mutation tool with no annotations, it should provide more behavioral context (e.g., idempotency, error handling) to be fully complete.

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 1 parameter with 0% description coverage, so the schema provides no semantic context. The description doesn't mention the 'name' parameter at all, failing to compensate for the schema gap. However, with only one parameter, the baseline is higher, but the description adds no value beyond what's inferred from the tool name.

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 'Create a new category' clearly states the verb ('Create') and resource ('category'), making the basic purpose understandable. However, it doesn't distinguish this tool from its sibling 'createMemo' or explain what a 'category' represents in this context, leaving the purpose somewhat vague.

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 'updateCategory' or 'getCategories'. There's no mention of prerequisites (e.g., whether categories must be unique), exclusions, or typical use cases, leaving the agent with minimal context for decision-making.

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