Skip to main content
Glama

Register editable fields

register_fields

Register custom fields as meta boxes or settings pages, exposing them via REST API. Supports 13 field types for building editable themes without code.

Instructions

Register custom fields that appear as native meta boxes in wp-admin (or as a settings page for site-wide options), and are automatically exposed to the REST API so they can be read and written afterwards. Use this when building a theme so the site stays editable by humans without touching code. Values are stored as ordinary post meta or options, so the data survives even if this tooling is removed. Thirteen field types are supported: text, textarea, wysiwyg, number, email, url, date, select, checkbox, radio, color, image, gallery, repeater.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesGroup title shown above the meta box.
fieldsYesThe fields in this group, in display order.
contextNopost_meta: a meta box on content. options: a site-wide settings page.post_meta
site_idNoWhich configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids.
positionNoWhere the meta box sits in the editor.normal
group_keyYesUnique key for this field group, e.g. "homepage_hero".
post_typesNoWhich content types get the meta box, e.g. ["page"]. Required for post_meta.
descriptionNoHelp text shown at the top of the group.
Behavior4/5

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

Annotations indicate openWorldHint=true and destructiveHint=false, which the description aligns with. It adds valuable behavior details: fields are exposed to the REST API, data persists as post meta or options, and remains even if tooling is removed. This goes beyond annotations by explaining the persistence and API exposure, though it doesn't mention potential side effects like overwriting existing groups with the same key.

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 three sentences that efficiently pack purpose, use case, and behavioral details. It front-loads the primary action and follows with a clear usage directive. While not minimal, every sentence adds value—no redundancies or filler. The length is appropriate for the tool's complexity.

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

Completeness4/5

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

Given the parameter count (8) and high schema coverage, the description covers the essential context: it explains what the tool does, when to use it, and key side effects. It doesn't explain every parameter in detail (schema does that) and omits details like how the 'position' parameter affects the meta box, but the overall behavior and intent are clear. For a registration tool with no output schema, this is sufficient.

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 adds meaningful context beyond the schema: it explains the 'context' parameter (post_meta vs options) and the 'fields' array's display order, and clarifies that 'group_key' should be unique. It also lists the thirteen field types, which aids the agent in constructing valid field definitions. These additions justify a score above baseline.

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 clearly identifies the action (register custom fields), the resource (custom fields/meta boxes/settings pages), and the context (WordPress theme development). It distinguishes itself from sibling tools like set_content_meta or update_site_settings by focusing on registration of field definitions rather than setting values. The phrase 'Use this when building a theme...' reinforces the specific purpose.

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?

The description explicitly states the intended use case: 'Use this when building a theme so the site stays editable by humans without touching code.' It implies that this tool is for initial setup, not for day-to-day value manipulation. While it doesn't name alternative tools for writing values, the message is clear that after registration, values are read/written via other tools. The context is strong enough to guide an agent.

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/alokemajumder/wpxmcp'

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