Skip to main content
Glama

Set user meta

wp_update_user_meta
Destructive

Create or overwrite one user meta value (all stored values of the key are replaced). Refused: keys starting with "_", role and capability keys of any site (…capabilities, …user_level), session_tokens, default_password_nonce, use_ssl and credential-like keys; role and password are changed by wp_update_user. Needs edit_users, the right to edit this user and to edit this key; an unknown user is a not-found error. WordPress strips backslashes from the value. Returns updated, user_id and key. No undo point is recorded; wp_get_user_meta reads the value. Forwarded by AlphaBridge Connect to the one site this connection reaches.

Input Schema

NameRequiredDescriptionDefault
keyYesMeta key; stored lower-cased with characters other than a-z, 0-9, "_" and "-" removed (sanitize_key).
valueNoScalar or array of scalars (arrays may nest); an array is stored serialized. Omitted: an empty string.
user_idYesUser id, as wp_list_users returns it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / key / description
      Added value: +"Meta key; stored lower-cased with characters other than a-z, 0-9, \"_\" and \"-\" removed (sanitize_key)."
    • addedInput schema / properties / user_id / description
      Added value: +"User id, as wp_list_users returns it."
    • changedInput schema / properties / value / description
      Previous value: -"Scalar or array of scalars."New value: +"Scalar or array of scalars (arrays may nest); an array is stored serialized. Omitted: an empty string."
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations it discloses the critical destructive semantics (all stored values of the key are replaced), that no undo point is recorded, that WordPress strips backslashes from the value, and the exact return fields (updated, user_id, key). These are non-obvious behaviors an agent would otherwise discover only by failing, and none of it contradicts destructiveHint=true / readOnlyHint=false.

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-loads the operation and its replacement semantics, then the refusals, then permissions and return values — a sensible priority order with no filler sentences. It is dense and long for a three-parameter tool, but nearly every clause carries an operational fact an agent needs.

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 destructive, non-idempotent write with no output schema, the description covers return fields, error condition, permission requirements, forbidden keys, value coercion and undo absence. There is no meaningful omission an agent would need before calling it.

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 key, value and user_id are already documented, including sanitize_key normalization and array serialization. The description still adds meaning beyond the schema by noting that WordPress strips backslashes from the value, which is a value-transformation rule the schema does not mention.

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?

States a specific verb and resource ('Create or overwrite one user meta value') and immediately clarifies the replacement semantics of the underlying key. It distinguishes itself from wp_update_user explicitly, and names wp_get_user_meta as the read counterpart, so an agent can differentiate it from siblings without opening any schema.

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?

Gives explicit when-not rules (refused key prefixes: '_', capability/role keys, session_tokens, default_password_nonce, use_ssl, credential-like keys) and routes the excluded cases to wp_update_user for role and password. It also states the permission preconditions (edit_users, right to edit the user and the key) and the unknown-user failure mode.

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