Skip to main content
Glama

Write a site option

set_option

Write a value to a WordPress option to alter plugin or theme behavior. Read the current value first to prevent site breakage.

Instructions

Write a value to the WordPress options table. Options drive plugin and theme behaviour, and a wrong value can break the site — read the current value first with get_options, and prefer a plugin's own settings screen or ability where one exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesOption name.
valueNoNew value. Arrays and objects are serialised the way WordPress expects.
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.
autoloadNoWhether to load this option on every page request. Leave unset to keep the current behaviour; large values should not autoload.
Behavior4/5

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

Annotations already indicate write behavior (readOnlyHint=false) and non-idempotency, so the description correctly does not repeat these. It adds valuable behavioral context: a wrong value can break the site, and reading first is recommended. This goes beyond the structured annotations and helps the agent understand risk. No contradiction with annotations.

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 a single, focused sentence that front-loads the core action and then adds critical safety guidance. It is not verbose or redundant, and every phrase contributes value. The structure is efficient and easy to parse.

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?

For a write tool with four well-documented parameters and no output schema, the description covers the essential operational context: what the tool does, the risk involved, and the recommended pre-condition (reading before writing). It does not explain return values, but no output schema exists, so that is not a gap. The guidance about preferring plugin settings adds important decision-making context.

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 parameters (name, value, site_id, autoload) with meaningful descriptions. The description does not add parameter-specific semantics beyond what the schema provides, which is acceptable given the high coverage. Baseline 3 is appropriate.

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

Purpose4/5

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

The description clearly states the verb ('write') and resource ('the WordPress options table'), and adds context that options drive plugin/theme behavior. This distinguishes it from the read sibling get_options, though it doesn't explicitly contrast with other write tools like set_theme_mod or update_site_settings. The purpose is unambiguous and specific.

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?

The description provides explicit usage guidance: read the current value first with get_options, and prefer a plugin's own settings screen or ability when one exists. This tells the agent exactly when to use this tool and when not to, naming a concrete alternative. No inference is required.

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