Skip to main content
Glama

wp_ensure_category

Ensure a WordPress category exists by returning its ID if present or creating it when missing. Use with slug and parent options for precise control.

Instructions

Return an existing category, or create it. Safe to call repeatedly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
slugNo
parentNo
dry_runNoPreview changes without writing

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.3.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden. It explicitly reveals the get-or-create behavior and idempotency ('Safe to call repeatedly'), which is valuable. It does not describe permissions, failure modes, or what happens on invalid input, but the core side-effect semantics are disclosed.

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 two short sentences with no filler. The main behavior is front-loaded, and 'Safe to call repeatedly' adds essential info without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple get-or-create tool, the description covers the key purpose and safety. However, with no output schema, it does not describe the return value, and it does not explain matching criteria or how slug/parent affect creation. These gaps make it adequate but not fully complete.

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

Parameters2/5

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

Schema description coverage is only 25%, and the tool description does not compensate. Only dry_run has a schema description; name, slug, and parent are left undefined. The description does not clarify whether existing categories are matched by name or slug, which is a meaningful ambiguity for correct invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

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

The description uses a specific verb and resource: 'Return an existing category, or create it.' This clearly conveys an idempotent ensure operation and distinguishes it from unconditional creation tools like wp_create_category and listing tools like wp_list_categories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'Safe to call repeatedly' implies this is intended for get-or-create scenarios, but it never explicitly says when to prefer this over wp_create_category or wp_list_categories. Usage context is implied rather than stated, with no exclusions or alternatives named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

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