Skip to main content
Glama

wp_update_category

Modify an existing WordPress category by updating its name or other properties using the category ID.

Instructions

Updates an existing 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 update.
nameNoThe new name for the category.

Implementation Reference

  • Registration of the 'wp_update_category' tool within TaxonomyTools.getTools(), including name, description, input parameters schema, and handler binding.
    {
      name: "wp_update_category",
      description: "Updates an existing category.",
      parameters: [
        {
          name: "id",
          type: "number",
          required: true,
          description: "The ID of the category to update.",
        },
        {
          name: "name",
          type: "string",
          description: "The new name for the category.",
        },
      ],
      handler: this.handleUpdateCategory.bind(this),
  • The core handler function for the 'wp_update_category' tool. Casts input parameters to UpdateCategoryRequest type and invokes the WordPressClient's updateCategory method, handling success and error responses.
    public async handleUpdateCategory(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> {
      const updateParams = params as unknown as UpdateCategoryRequest;
      try {
        const category = await client.updateCategory(updateParams);
        return `✅ Category ${category.id} updated successfully.`;
      } catch (_error) {
        throw new Error(`Failed to update category: ${getErrorMessage(_error)}`);
      }
    }
  • TypeScript interface definitions for category requests. UpdateCategoryRequest (extends Partial<CreateCategoryRequest> with required id) provides input schema validation for the tool handler.
    export interface CreateCategoryRequest {
      name: string;
      description?: string;
      slug?: string;
      parent?: number;
      meta?: WordPressMeta;
    }
    
    export interface UpdateCategoryRequest extends Partial<CreateCategoryRequest> {
      id: number;
    }
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. It states 'Updates an existing category' which implies a mutation operation, but doesn't disclose behavioral traits like required permissions, whether changes are reversible, error handling, or what happens to unspecified fields. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 a single sentence with zero wasted words. It's appropriately sized for a simple update operation and front-loads the essential information. Every word earns its place in this minimal but complete statement of purpose.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the update operation returns, what permissions are needed, or potential side effects. The agent must rely entirely on the input schema and tool name to understand this tool's behavior, which is insufficient for safe invocation.

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 (site, id, name) with good descriptions. The tool description adds no 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.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Updates an existing category' clearly states the action (update) and resource (category), but it's vague about what specific aspects can be updated. It distinguishes from sibling tools like wp_create_category (create vs update) but doesn't differentiate from other update tools like wp_update_post or wp_update_tag beyond the resource type.

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 an existing category ID), when not to use it, or how it compares to related tools like wp_create_category or wp_delete_category. The agent must infer usage from the tool name alone.

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