Skip to main content
Glama

diff_schema

Read-only

Compare a snapshot against the live Directus data model to preview migration operations before applying changes; no data is modified.

Instructions

Compares a snapshot against the live data model and reports the operations that applying it would perform. Read-only, nothing is modified, which makes it the safe way to preview a migration before apply_schema, the tool that consumes the { hash, diff } object returned here. mode mirror (default) includes deletions so the live model would end up matching the snapshot exactly; merge drops them for a strictly additive diff. force bypasses the Directus version and database vendor checks and risks producing a diff that cannot be applied. An empty diff means the model already matches.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "snapshot": "<snapshot>"
    },
    "name": "diff_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo'mirror' (default) reports every operation including deletions; 'merge' excludes deletions for an additive diff.
forceNoBypass the Directus version and database vendor checks
snapshotYesA snapshot as returned by get_schema_snapshot

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv12.3.3

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, but the description goes well beyond them by spelling out that mirror mode includes deletions, that force bypasses Directus version and database vendor checks and can yield an unapplicable diff, and that an empty diff means the model already matches. That is exactly the consequence-level detail an agent needs before choosing a mode.

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 core action is front-loaded in the first sentence, followed by safety, mode semantics, force risk, and the empty-diff case in descending order of importance. It is dense but no sentence is redundant, and it also disambiguates the two tools most easily confused.

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?

Without an output schema, the description still names the returned { hash, diff } object and explains that apply_schema consumes it, closing the loop between the two tools. Combined with the mode and force caveats, an agent has everything needed to invoke this correctly and interpret the result.

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 baseline would be 3; the description earns above that by restating the default for mode, contrasting the two enum values in terms of deletive vs additive behavior, and explaining the concrete risk carried by force rather than just its mechanical meaning. It adds consequence rather than syntax, which is the more valuable contribution when the schema already documents formats.

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 ('Compares a snapshot against the live data model') plus the output ('reports the operations that applying it would perform'). It also explicitly separates itself from the sibling that consumes its output, apply_schema, so an agent can choose between preview and execution without opening either 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-to-use guidance ('the safe way to preview a migration before apply_schema') and then explains how to choose between the two modes: mirror for exact parity including deletions, merge for a strictly additive diff. It also names the condition under which force is dangerous, which functions as a when-not-to-use rule.

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