Skip to main content
Glama

Clean up options and transients

cleanup_options
Destructive

Clean up your WordPress options table by deleting expired transients, disabling autoload for named options, or removing specific options. Preview changes in a dry run, then apply with a confirmation token.

Instructions

Reduce options-table weight in one of three ways: delete_expired_transients (expired transients and site transients, plus timeout rows whose value is gone), set_autoload_off (stop loading named options on every request — they remain readable on demand), or delete_options (remove named options). Always two steps: the first call is a dry run that returns exactly what would change, the bytes saved, what was refused and a confirm_token; repeat the identical call with that token to apply it. Core WordPress options, wpxmcp's own state and lock-out options (siteurl, active_plugins, user roles, salts…) are refused. Deleting an option a plugin still uses resets that plugin's setting, so check owners in inspect_options first. Needs the companion plugin.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namesNoOption names for set_autoload_off or delete_options, exactly as listed by inspect_options. Ignored for delete_expired_transients.
actionYesdelete_expired_transients, set_autoload_off (needs names) or delete_options (needs names).
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.
confirm_tokenNoToken from this tool's dry-run preview. Omit it to preview; pass it back with identical action and names to apply.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only indicate destructiveHint=true; the description goes far beyond by disclosing the dry-run preview with confirm_token, the exact return contents (what would change, bytes saved, refusals), the permanent refusal of core WordPress options, and the risk that deleting an option resets a plugin's settings. This is exactly the behavioral context an agent needs to safely invoke a destructive tool.

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 dense but not bloated; every sentence carries operational weight. It front-loads the three modes, then the two-step process, then limitations and risks. The only slight deduction is for the density – a reader must parse carefully – but there is no filler or redundancy.

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?

Given there is no output schema, the description compensates by specifying exactly what the dry run returns (what would change, bytes saved, refused items, confirm_token). It also covers prerequisite dependencies (companion plugin), safety constraints (core options refused), and the downstream risk of plugin settings. For a destructive, multi-mode tool, this is comprehensive.

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?

With 100% schema coverage, the baseline is 3, but the description adds real value: it tells the agent that names must be 'exactly as listed by inspect_options', explains that confirm_token comes from the dry-run preview, and clarifies that names is ignored for delete_expired_transients (matching the schema but reinforcing it). It also defines the three action modes in user-oriented terms beyond the raw enum.

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 opens with a specific verb and resource ('Reduce options-table weight') and then enumerates the three distinct actions (delete_expired_transients, set_autoload_off, delete_options), each with a brief explanation. This clearly distinguishes the tool from siblings like get_options, set_option, or inspect_options, which deal with reading/writing individual options rather than bulk cleanup.

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 provides strong usage context: it explains the mandatory two-step dry-run/apply flow, warns to 'check owners in inspect_options first' before deleting, and notes the dependency on the companion plugin. It also declares that core/lock-out options are refused, setting expectations. It doesn't explicitly name alternative tools for the same purpose (e.g., when to use purge_cache instead), which prevents a 5, but the guidance is clear and actionable.

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