Skip to main content
Glama

Set a transient

wp_set_transient
Destructive

Set a transient value with an optional expiration (seconds), overwriting one of the same name. Only names under a prefix the site owner allowed via the "ab_mcp_pro_transient_prefix_allowlist" filter (empty by default); the plugin's own "ab_mcp" state is never reachable; any other name is refused with an error. Returns set and name. Requires manage_options. wp_delete_transient removes one by name; wp_cleanup_transients removes the expired ones. Forwarded by AlphaBridge Connect to the one site this connection reaches.

Input Schema

NameRequiredDescriptionDefault
nameYesTransient name without the _transient_ prefix: ASCII letters, digits, _ - . and : only, at most 172 characters, starting with an allowed prefix (case-sensitive).
valueYesScalar, null, or an array (nested arrays allowed) whose leaves are scalars or null.
expirationNoLifetime in seconds. 0 or omitted: no expiry for a new transient; an existing one stored in the database keeps its current expiry.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / expiration / description
      Previous value: -"Seconds. 0 = no expiry."New value: +"Lifetime in seconds. 0 or omitted: no expiry for a new transient; an existing one stored in the database keeps its current expiry."
    • addedInput schema / properties / name / description
      Added value: +"Transient name without the _transient_ prefix: ASCII letters, digits, _ - . and : only, at most 172 characters, starting with an allowed prefix (case-sensitive)."
    • changedInput schema / properties / value / description
      Previous value: -"Scalar or array of scalars."New value: +"Scalar, null, or an array (nested arrays allowed) whose leaves are scalars or null."
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Adds a great deal beyond the annotations: the allowlist filter name and its empty default, the hard exclusion of the plugin's own 'ab_mcp' state, the refusal-on-other-names behavior, the required capability, and the return shape ('set and name'). This is the context an agent needs before attempting a destructive overwrite.

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?

Front-loaded with the core action and overwrite semantics, then constraints. Dense but each clause carries information; the trailing note about AlphaBridge forwarding is slightly tangential but contextually useful.

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?

No output schema exists, yet the description states the return values ('Returns set and name'). Combined with auth requirements, allowlist refusal behavior, and overwrite semantics, an agent has everything needed to call this correctly.

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 name, value and expiration in depth. The description only restates the expiration unit and the overwrite semantics, adding no syntax or format detail beyond the schema. Baseline 3 applies.

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?

Specific verb+resource ('Set a transient value') with scope ('overwriting one of the same name'). It is clearly distinguishable from wp_delete_transient and wp_cleanup_transients, which are named in the body.

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?

Explicitly routes removal work to wp_delete_transient ('removes one by name') and wp_cleanup_transients ('removes the expired ones'). The preconditions for a successful write (allowlisted prefix, manage_options) are also given. It lacks an explicit 'when not to use' beyond the refusal cases, so it falls just short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources