Skip to main content
Glama
108yen
by 108yen

Create Category

createCategory

Create a new category for organizing memos in the local database. Provide a unique category name to structure your memo collection.

Instructions

Create a new category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes

Implementation Reference

  • The core handler/logic for createCategory. Creates a new category with an auto-generated ID and timestamps, stores it in the database, and returns it.
    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
    }
  • Zod schema and TypeScript type for validating the createCategory input. Defines the expected shape: name (string, min length 1).
    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, including its description, input schema (from CreateCategorySchema.shape), output schema, and the handler callback that invokes the repository function.
    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 },
        }
      },
    )
  • The CategorySchema used as the output schema for createCategory, defining the full category shape including id, name, createdAt, updatedAt.
    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?

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states the action without disclosing side effects, permissions needed, or potential errors (e.g., duplicate names). This is insufficient for a create operation.

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

Conciseness3/5

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

The description is extremely brief (4 words), which is concise but at the expense of completeness. It lacks front-loaded critical information such as parameter details or usage hints. Every word is earned, but more words are needed.

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 simplicity (1 parameter, output schema exists), the description should at least mention that the tool creates a new category and perhaps returns the created object. It does not, leaving significant gaps in contextual understanding.

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

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage for the single required parameter 'name'. The description does not mention the parameter or its purpose, leaving the agent to infer semantics solely from the schema's minLength constraint. This adds no value beyond the schema.

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 verb 'Create' and the resource 'category', making the tool's primary action obvious. However, it does not differentiate from sibling tools like createMemo, and the context of 'category' vs other resources is left implicit.

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 searchMemos or updateCategory. No context about prerequisites, restrictions, or typical use cases is given.

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