Skip to main content
Glama

Write a site option

set_option

Write a value to a WordPress option to adjust plugin or theme behavior. Read existing values with get_options first, and prefer official settings screens to avoid breaking the site.

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.
valueYesNew 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / required
      Previous value: -[
      -  "name"
      -]New value: +[
      +  "name",
      +  "value"
      +]
  2. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

The mutation nature is already indicated by readOnlyHint=false and idempotentHint=false, but the description adds valuable real-world risk context: a wrong value can break the site and the current value should be read first. It goes beyond annotations, though it does not detail overwrite semantics or response behavior.

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 compact and front-loaded: it states the operation first, then the risk, then the safer alternatives. Every clause earns its place without repeating schema details.

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 4-parameter mutation tool with a fully documented schema and mutation-relevant annotations, the description supplies the missing operational context: options affect site behavior, wrong values are dangerous, and safer alternatives exist. With no output schema, detailed return-value documentation is not required.

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?

Since schema description coverage is 100%, the schema already explains name, value, site_id, and autoload. The description adds caution around the value parameter but does not provide additional parameter-level meaning beyond what is already in the schema, so baseline 3 is appropriate.

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 states a specific verb ('Write') and a precise resource ('WordPress options table'), which clearly identifies the tool's function. It distinguishes itself from read operations like get_options and from other site configuration tools.

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 explicitly instructs the agent to read the current value first with get_options and to prefer a plugin's own settings screen or ability when available. This gives concrete when-to-use and when-not-to-use guidance beyond what the schema or annotations provide.

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