Skip to main content
Glama

files_diff_against_disk

Compare a file's on-disk content with its full-text search index to diagnose stale search results. If content diverged or no index row exists, refresh the project index to fix drift.

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

NameRequiredDescriptionDefault
file_idYesFile ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv6.1.2

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it declares the tool is read-only with no side effects, no auth, and no rate limits, and enumerates all four possible status outcomes plus exactly which fields are returned on divergence.

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 tightly packed sentences, front-loaded with purpose, then return shape, then the read-only caveat, then usage routing. Every sentence earns its place with no filler.

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?

No output schema exists, and the description compensates by describing the status enum and the divergence payload in detail. Combined with the routing advice to projects_refresh_index, an agent has everything needed to call and act on this tool.

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?

The single parameter file_id has 100% schema coverage, so the schema already documents it. The description adds no syntax, format, or constraint details beyond what the schema provides; baseline 3 applies when the schema does the heavy lifting.

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 precise verb+resource: "Diagnose drift between one file's disk content and its FTS index." It immediately distinguishes itself from the sibling files_get_diff by explicitly saying it returns diagnostics, not a full diff.

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 when-to-use ("Use when search results look stale"), explicit follow-up action ("if status is diverged or no_index_row, run projects_refresh_index"), and an explicit alternative for the overlapping case (files_get_diff for full diffs). Nothing is left to inference.

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