Skip to main content
Glama

wp_create_category

Create a new category in WordPress to organize content, specifying name and optional description for improved site structure.

Instructions

Creates a new category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoThe ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured.
nameYesThe name of the category.
descriptionNoThe description for the category.

Implementation Reference

  • The core handler function for the wp_create_category tool. It casts input parameters to CreateCategoryRequest type and delegates to the WordPressClient's createCategory method, returning a formatted success message or propagating errors.
    public async handleCreateCategory(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const createParams = params as unknown as CreateCategoryRequest;
      try {
        const category = await client.createCategory(createParams);
        return `✅ Category "${category.name}" created successfully with ID: ${category.id}.`;
      } catch (_error) {
        throw new Error(`Failed to create category: ${getErrorMessage(_error)}`);
      }
    }
  • Tool registration within TaxonomyTools.getTools() method, defining the tool's name, description, input parameters schema, and binding to the handler function.
    {
      name: "wp_create_category",
      description: "Creates a new category.",
      parameters: [
        {
          name: "name",
          type: "string",
          required: true,
          description: "The name of the category.",
        },
        {
          name: "description",
          type: "string",
          description: "The description for the category.",
        },
      ],
      handler: this.handleCreateCategory.bind(this),
    },
  • TypeScript interface defining the structure of CreateCategoryRequest used for type safety and validation in the category creation process.
    export interface CreateCategoryRequest {
      name: string;
      description?: string;
      slug?: string;
      parent?: number;
      meta?: WordPressMeta;
    }
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. 'Creates' implies a write/mutation operation, but the description doesn't mention authentication requirements, permission levels needed, whether the operation is idempotent, what happens on duplicate names, or what the return value looks like. For a mutation tool with zero annotation coverage, this is insufficient.

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 - just three words. It's front-loaded with the essential action and resource. There's zero wasted language or unnecessary elaboration. Every word earns its place in conveying the core function.

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?

For a mutation tool (category creation) with no annotations and no output schema, the description is inadequate. It doesn't explain what happens after creation, what permissions are required, how to handle errors, or what the tool returns. The context signals show this is a 3-parameter tool with one required parameter, but the description provides no guidance on parameter importance or usage patterns.

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 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 action ('creates') and resource ('new category'), making the purpose immediately understandable. However, it doesn't differentiate this tool from other creation tools like wp_create_post or wp_create_tag, which would require a 5. The verb+resource combination is specific but lacks sibling differentiation.

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. With sibling tools like wp_update_category and wp_list_categories available, there's no indication of when creation is appropriate versus updating or listing. The description offers no context about prerequisites, use cases, or exclusions.

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/docdyhr/mcp-wordpress'

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