Skip to main content
Glama

files.diff_against_disk

Check if a file's indexed content matches its current disk version. When they diverge, get line-level differences and fix stale search results by refreshing the index.

Instructions

Diagnose drift between one file's disk content and its FTS index. Status is one of in_sync, diverged, disk_unreadable, or no_index_row. On divergence returns sizes, line counts, the first divergent line number, and the disk vs index sample for that line — NOT a full diff (use files.get_diff for full diffs between commits). Read-only; no side effects, auth, or rate limits. Use when search results look stale; if status is diverged or no_index_row, run projects.refresh_index to fix.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesFile ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.7.2

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It explicitly states 'Read-only; no side effects, auth, or rate limits', which is thorough. It also clarifies what the tool does NOT return ('NOT a full diff'), preventing unrealistic expectations. Minor gap: it doesn't detail the exact structure of the output beyond listing fields, but the core behavioral characteristics are well covered.

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?

Description is concise and structured; the first sentence states the purpose, followed by status list and return details, then usage guidance. It is front-loaded with the primary purpose and status enumeration. Slightly dense but no wasted words; each sentence adds value.

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 tool with a single parameter, full schema coverage, and no output schema, the description covers everything an agent needs: purpose, statuses, return fields, exclusions, usage triggers, and remediation. It is complete enough to call correctly and interpret results. Minor deduction for not detailing the output format precisely, but the essentials are present.

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 the schema already documents the file_id parameter. The description does not add much beyond the schema—it implies the parameter is a file identifier but doesn't specify how to find or validate it. Given the high coverage, a baseline 3 is appropriate; the description doesn't need to compensate.

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?

Clearly states the diagnostic purpose: detect drift between disk content and FTS index, and enumerates the possible statuses. It explicitly distinguishes itself from files.get_diff, preventing confusion with that sibling. The verb 'diagnose' and resource 'file' are specific and unambiguous.

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?

Provides explicit guidance on when to use ('when search results look stale') and what to do if divergence is found ('run projects.refresh_index'). It also directs to files.get_diff for full diffs, covering both when-to-use and when-not-to-use. This is exemplary.

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