Skip to main content
Glama

create_category

Create a new category by specifying a name, with optional description, publication status, and parent category.

Instructions

Create a category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesTitle of the category.
descriptionNoThe description of the category.
is_publishedNoBoolean if the category is published on the website.
parent_idNoUnique identifier of the parent category

Implementation Reference

  • The actual handler logic for the create_category tool. It receives a body object (containing name, optional description, is_published, parent_id), calls apiPost to POST /categories, logs the response, and formats the result using formatCreate.
    async (body) => {
      try {
        const record = await apiPost<EduframeRecord>("/categories", body);
        void logResponse("create_category", body, record);
        return formatCreate(record, "categorie");
      } catch (error) {
        return formatError(error);
      }
    },
  • Input schema for create_category tool. Defines required 'name' (string) and optional 'description' (string), 'is_published' (boolean), and 'parent_id' (number) using Zod validation.
    inputSchema: {
      name: z.string().describe("Title of the category."),
      description: z.string().optional().describe("The description of the category."),
      is_published: z.boolean().optional().describe("Boolean if the category is published on the website."),
      parent_id: z.number().int().optional().describe("Unique identifier of the parent category"),
    },
  • Registration of the 'create_category' tool using server.registerTool(), which wires the name, description, annotations, inputSchema, and handler together.
    server.registerTool(
      "create_category",
      {
        description: "Create a category.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
        inputSchema: {
          name: z.string().describe("Title of the category."),
          description: z.string().optional().describe("The description of the category."),
          is_published: z.boolean().optional().describe("Boolean if the category is published on the website."),
          parent_id: z.number().int().optional().describe("Unique identifier of the parent category"),
        },
      },
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/categories", body);
          void logResponse("create_category", body, record);
          return formatCreate(record, "categorie");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The registerAllTools function that iterates over all tool registration functions, including registerCategorieTools (which registers create_category).
    export function registerAllTools(server: McpServer): void {
      for (const register of tools) {
        register(server);
      }
  • The formatCreate helper used by create_category to format the API response into a human-readable success message with the created record.
    export function formatCreate(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `Successfully created ${resourceName}:\n\n${formatJSON(record)}${RESPONSE_LOG_HINT}`,
          },
        ],
      };
Behavior3/5

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

Annotations already indicate a non-read, non-destructive mutation. The description adds no further behavioral context (e.g., side effects, permissions, return value). Given annotation coverage, a 3 is appropriate.

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?

Extremely concise (4 words), but lacks structure or additional details. While brevity is positive, it omits useful information that could aid the agent.

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?

No output schema and no description of return values or side effects. The description does not explain what a category is or where it is used, leaving gaps for the agent.

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?

Input schema covers all 4 parameters with descriptions (100% coverage). The tool description adds no extra meaning beyond what the schema provides, so baseline 3.

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 resource (category). It is direct and unambiguous, but lacks context about what a category represents in this system, especially among many sibling create tools.

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 on when to use this tool versus alternatives like create_course or create_program. No prerequisites or exclusions are mentioned.

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/martijnpieters/eduframe-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server