Skip to main content
Glama

wp_delete_category

Remove a category from a WordPress site by specifying its ID, enabling content organization cleanup and taxonomy management.

Instructions

Deletes a 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.
idYesThe ID of the category to delete.

Implementation Reference

  • The handler function that implements the core logic of the wp_delete_category tool by calling deleteCategory on the WordPressClient.
    public async handleDeleteCategory(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const { id } = params as { id: number };
      try {
        await client.deleteCategory(id);
        return `✅ Category ${id} has been deleted.`;
      } catch (_error) {
        throw new Error(`Failed to delete category: ${getErrorMessage(_error)}`);
      }
    }
  • Registers the wp_delete_category tool in the TaxonomyTools.getTools() array, including schema (parameters) and handler reference.
    {
      name: "wp_delete_category",
      description: "Deletes a category.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The ID of the category to delete.",
        },
      ],
      handler: this.handleDeleteCategory.bind(this),
    },
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. 'Deletes a category' implies a destructive mutation, but it doesn't disclose critical behavioral traits: whether deletion is permanent, what happens to associated posts, required permissions, error conditions, or rate limits. For a destructive tool with zero annotation coverage, this is a significant gap.

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

Conciseness4/5

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

The description is extremely concise ('Deletes a category.')—a single sentence with no wasted words. It's front-loaded with the core action, though it could benefit from additional context. The brevity is efficient but borders on under-specification.

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 complexity (destructive operation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects, usage context, or output expectations. For a deletion tool in a rich sibling set, this minimal description leaves too many gaps for effective agent use.

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%, with clear documentation for both parameters (site and id). The description adds no parameter semantics beyond what the schema provides—it doesn't explain parameter relationships, constraints, or examples. With high schema coverage, the baseline 3 is appropriate as the description doesn't compensate but doesn't detract either.

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 'Deletes a category' clearly states the action (delete) and resource (category), but it's overly simplistic and doesn't differentiate from sibling deletion tools like wp_delete_post, wp_delete_comment, or wp_delete_tag. It specifies what it does but lacks the specificity needed for a 4 or 5 score.

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. The description doesn't mention prerequisites (e.g., needing category ID), exclusions (e.g., cannot delete default categories), or related tools like wp_update_category or wp_list_categories. This leaves the agent without context for proper tool 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/docdyhr/mcp-wordpress'

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