Skip to main content
Glama

Unschedule cron events

wp_unschedule_cron
Destructive

Unschedule every pending WP-Cron event of one hook whose arguments equal args, single and recurring alike. Returns cleared (the number of events removed, 0 when none matched) and hook. Permanent: no undo point is recorded, an event runs again only once it is scheduled again, and one already running is not stopped. Any hook can be cleared, not only those allowed for wp_schedule_cron. Requires manage_options. Forwarded by AlphaBridge Connect to the one site this connection reaches.

Input Schema

NameRequiredDescriptionDefault
argsNoArguments the events were scheduled with; only events with exactly these arguments are cleared. Default: none (events scheduled without arguments).
hookYesAction hook name of the events, as wp_get_cron shows it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / args / description
      Added value: +"Arguments the events were scheduled with; only events with exactly these arguments are cleared. Default: none (events scheduled without arguments)."
    • addedInput schema / properties / hook / description
      Added value: +"Action hook name of the events, as wp_get_cron shows it."
  2. Added

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/idempotentHint annotations by spelling out the consequences: no undo point is recorded, the event only runs again once rescheduled, a currently running instance is not stopped, and manage_options is required. It also describes the return payload (cleared count, 0 when nothing matched, plus hook).

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?

Four sentences, each carrying distinct payload: what is removed, what is returned, what is irreversible, and what permissions/scope apply. The core action is front-loaded ahead of caveats.

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?

With no output schema, the description supplies the return fields itself, plus permission requirements, irreversibility, and multi-site forwarding scope. There is nothing an agent would need to know before calling this that is left unstated.

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 coverage is 100%, so both parameters are already documented in the schema, including the default of no arguments. The description reinforces that arguments must match exactly and that both single and recurring events are covered, but adds little syntactic or formatting detail beyond the schema.

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 with exact scope: unschedule every pending WP-Cron event matching one hook and an exact argument set, single and recurring alike. It also positions itself against wp_schedule_cron (any hook, not just the whitelisted ones) and references wp_get_cron for hook naming, so an agent can distinguish it from siblings.

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?

It makes clear the selection condition (hook + exact args) and that it will not stop an already-running event, and it points to wp_get_cron as the way to see hook names. What's missing is an explicit instruction to inspect with wp_get_cron before clearing, or a statement of when not to use it.

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