Skip to main content
Glama

Apply approved folder rules (beta)

apply_rules
Destructive

Apply an approved rules preview to move matched messages into their rule folders using its token; call only after the user explicitly approves the preview.

Instructions

Beta: Move the batch an approved preview_rules token covers to its rules' folders; only call after the user explicitly approved the preview.

The rules engine is not fully reliable yet; preview first and check the results.

Use it only with a token from preview_rules that the user approved, or the continuation_token of an earlier partial run of that approval; preview_action tokens go to move, set_read_state or label instead. Unless the operator turned it off, the user then confirms the exact change in the client's form; a continuation of an approval already confirmed needs no new form. Read-state changes use the preview's setting. A continuation refuses if a row or the rules changed, and keeps its token: preview again. limit caps the messages this call processes.

Returns log_ids (a list even for zero or one chunk), counts, run/continuation state and message IDs; verbose=true adds full rows. Pass each log_id to undo_action to move that chunk back. Any untouched remainder gets resume=true and a continuation_token, redeemed here. An expired, used or unknown token refuses: preview again.

Input Schema

NameRequiredDescriptionDefault
limitNoMessages to process in this call, 1 to 200. A value above the approved total refuses and keeps the token.
tokenYesSingle-use token from the preview the user approved, or the continuation_token of an earlier partial run of that approval.
verboseNotrue adds messages and replaces blocked_ids, missing_ids and mismatched_ids with full blocked, missing and mismatched rows.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond destructiveHint=true and idempotentHint=false, the description discloses single-use token semantics, refusal conditions (changed rows/rules, expired/used/unknown tokens), the client-side confirmation-form step, limit behavior, and the undo path via undo_action with log_ids. This is unusually rich behavioral context for a mutation 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?

Front-loads the action and the safety gate in the first sentence, and every subsequent sentence adds a rule or failure mode. It is dense and slightly repetitive ('preview first', 'preview again' appear multiple times) but not padded.

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, token-gated, partially-resumable batch operation, the description covers prerequisites, confirmation flow, resumption, refusal handling, and the undo route. It explains return values (log_ids, counts, continuation state) even though an output schema exists, which is harmless reinforcement rather than a gap.

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 the schema already defines all three parameters, and the description adds the token lifecycle meaning (single-use, approval continuation, refusal-and-keep-token on over-limit) that makes the required token param usable. It adds less for limit and verbose, which the schema already explains well.

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 first sentence states a specific verb and resource: 'Move the batch an approved preview_rules token covers to its rules' folders.' It also implicitly distinguishes this from preview_rules (which produces the token) and from move/label/set_read_state (which take preview_action tokens).

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?

Explicit gating: 'only call after the user explicitly approved the preview,' plus concrete alternatives ('preview_action tokens go to move, set_read_state or label instead') and the condition for continuation tokens needing no new form. An agent knows exactly when this tool is and is not the right call.

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