Skip to main content
Glama

Create a term

wp_create_term

Create a new WordPress category, tag, or custom taxonomy term and return its ID. Use it to add taxonomy terms; update existing terms separately.

Instructions

Create a new term (category, tag or custom taxonomy term) in a taxonomy. Returns {created: true, term_id}. Needs the taxonomy's right to manage terms (for categories and tags: manage_categories). WordPress refuses a parent that does not exist and, without a distinct slug, a name the taxonomy already has (in a hierarchical taxonomy: under the same parent). Existing terms are changed with wp_update_term.

Input Schema

NameRequiredDescriptionDefault
nameYesDisplay name of the new term.
slugNoURL slug. Default: derived from the name. WordPress adds a suffix when the slug is taken.
parentNoId of the parent term in the same taxonomy, for hierarchical taxonomies such as categories. Default 0: top level.
taxonomyYesTaxonomy name, e.g. "category" or "post_tag", as wp_get_taxonomies lists it. An unknown taxonomy is refused.
descriptionNoTerm description. Default empty.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare the non-read-only, non-destructive, non-idempotent profile, so the bar is lower, and the description still adds real value: the capability requirement, the exact refusal conditions (missing parent, duplicate name, with the hierarchical-parent nuance), and the response shape {created: true, term_id}. It doesn't state whether creation fires hooks or what happens on partial failure, keeping it off a 5.

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?

Purpose and return value are front-loaded in the first sentence, and the rejection rules are packed into one dense sentence. A few clauses restate what the schema already documents (slug suffix behavior, parent id meaning), which is minor waste but not bloat.

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

Completeness5/5

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

For a 5-parameter mutation with no output schema, the description covers the return shape, permission requirement, failure modes, and the alternative tool. An agent has everything needed to call it correctly and to predict the two ways it will fail.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds semantics the schema does not carry: the uniqueness rule on `name` (scoped to parent in hierarchical taxonomies) and the referential constraint on `parent`. Some of its phrasing (slug suffix, unknown taxonomy refused) duplicates the schema, so it is additive rather than transformative.

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?

Opens with a specific verb+resource plus the resource's scope ("Create a new term (category, tag or custom taxonomy term) in a taxonomy"), and immediately states the return shape. It also names the sibling that handles the adjacent case, so an agent can distinguish it from wp_update_term without opening either schema.

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

Usage Guidelines5/5

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

Explicitly routes the alternative case: "Existing terms are changed with wp_update_term." It also gives the prerequisite (manage_categories for categories/tags) and the two conditions under which WordPress rejects the call, which is exactly the when-to-use context an agent needs before invoking.

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

Deploy Server

Other Tools