Skip to main content
Glama

apply_plan

Destructive

Apply a previously-previewed SQLMesh plan to update real data in the warehouse. Requires explicit confirmation and a valid plan_id from the current session.

Instructions

Apply a previously-previewed plan. THIS CHANGES REAL DATA in the target warehouse.

Requires confirm=true. plan_id must come from a plan() call in this same session -- plans aren't kept across server restarts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmNo
plan_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, but the description adds critical behavioral context: plans are not persisted across server restarts, so a stale plan_id will fail. It also reinforces the destructive nature by capitalizing the warning. This goes beyond the annotation without contradicting it.

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?

The description is two short, punchy sentences. The critical warning is front-loaded, and the requirements are stated in a separate line for emphasis. Every word earns its place; no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no output schema, the description covers prerequisites and session constraints. It doesn't describe the return value or side effects beyond 'changes real data,' but that's acceptable for a simple apply operation. The session-restart caveat is a useful completeness addition.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, leaving both parameters undocumented. The description compensates fully: it clarifies that confirm must be true and that plan_id must originate from a prior plan() call in the same session. This gives meaning to both parameters beyond their raw types and names.

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 clearly states the tool applies a previously-previewed plan, with a specific verb (apply) and resource (plan). It immediately distinguishes itself from the sibling 'plan' tool by emphasizing that this action changes real data. The warning 'THIS CHANGES REAL DATA' leaves no ambiguity about the tool's purpose.

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?

The description explicitly states the prerequisites: confirm=true is required and plan_id must come from a plan() call in the same session. This tells the agent exactly when and how to use the tool, and implies it should only be called after a plan() invocation. It also implicitly excludes use with stale plan IDs.

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