Skip to main content
Glama

fields_update_definition

Replace a complete ACF-compatible definition for a field group, post type, taxonomy, or options page; send the full definition, not a partial merge, to update it.

Instructions

Replace a definition as a whole: omitted keys fall back to the kind's defaults (it is not a merge, so send the full definition from fields_get_definition with your changes). The key always comes from the path; a key in the body is ignored. 404 when it does not exist, 409 cvrt_fields_defined_in_code for a PHP definition, 409 cvrt_fields_json_shadowed when a read-only JSON file still overrides the database copy. Returns the stored definition.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site": "<site>",
      "kind": "<kind>",
      "key": "<key>",
      "definition": "<definition>"
    },
    "name": "fields_update_definition"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesDefinition key (lowercase letters, digits, underscore), e.g. group_event or event
kindYesDefinition kind: field groups, post types, taxonomies or options pages
siteYesSite id (see list_sites)
definitionYesDefinition object in the shape of fields_get_schema for this kind (ACF-compatible)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.4.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and mostly succeeds: it discloses the destructive drop-to-defaults behavior, the path-vs-body precedence for the key, and three named failure modes (404 not found, 409 cvrt_fields_defined_in_code, 409 cvrt_fields_json_shadowed) plus the return value. It does not mention auth/permission requirements or whether the change can be reverted.

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?

Four tight sentences, no filler, and the most decision-critical fact (whole-object replacement) is front-loaded ahead of the workflow hint and the error catalog. The parenthetical clarifying non-merge semantics is the right use of parentheses.

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 destructive, four-parameter mutation with no annotations and no output schema, this covers the essentials: replacement semantics, key precedence, error codes, and what is returned ('the stored definition'), which substitutes for the missing output schema.

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 the baseline is 3; the description earns above that by clarifying two things the schema cannot convey - that 'key' is authoritative from the path and a body key is ignored, and that 'definition' must be the complete object in fields_get_schema shape rather than a patch.

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?

States a specific verb and resource ('Replace a definition as a whole') and immediately disambiguates the semantics that matter most: full replacement, not a merge. That distinction is what separates it from sibling write tools like fields_create_definition or fields_sync_definition, and an agent can act on it without opening another schema.

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

Usage Guidelines4/5

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

Gives an explicit workflow - pull the current object with fields_get_definition, apply changes, send the whole thing - and warns that partial bodies silently reset omitted keys to defaults. It stops short of explicitly excluding alternatives (e.g. create vs. sync vs. settings update), so the routing guidance is strong but not complete.

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