Skip to main content
Glama

smart_diff

Generates a token-budgeted semantic Git diff that filters noise, outlines AST changes, and detects leaked secrets before AI agents consume it.

Instructions

Generates a token-budgeted, noise-filtered semantic git diff with AST change outlines and secret leak detection.

Input Schema

NameRequiredDescriptionDefault
max_tokensNoStrict token ceiling for the diff output (default: 4000).
target_refNoGit revision or branch to diff against (e.g. 'HEAD~1', 'origin/main'). Defaults to working tree diff.
staged_onlyNoWhether to only diff staged files (git diff --cached).
filter_noiseNoWhether to automatically discard lockfiles and generated assets (default: true).
scan_secretsNoWhether to scan for high-entropy credentials and API keys (default: true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden, and it does disclose concrete traits: a strict token ceiling, noise filtering of lockfiles/generated assets, and secret scanning. However, it says nothing about the result payload structure, truncation behavior when the budget is exceeded, or failure modes for invalid refs — notable gaps for a tool with no output schema.

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?

A single dense sentence that front-loads the core output type before listing modifiers; nothing is wasted. It is adjective-heavy ('token-budgeted, noise-filtered, semantic'), which costs a little readability but not correctness.

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?

All parameters are optional, so an agent can invoke the tool with no arguments and the description makes clear the defaults are sane. The main missing piece is what the returned diff/outline looks like and how it degrades past the token ceiling, which matters given there is no output schema.

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 description coverage is 100% with all five parameters including defaults fully documented, so the schema does the heavy lifting. The description's phrases ('token-budgeted', 'noise-filtered', 'secret leak detection') only loosely mirror max_tokens, filter_noise, and scan_secrets without adding syntax or interaction detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Generates ... semantic git diff') and enumerates its distinctive features: token budgeting, noise filtering, AST change outlines, and secret leak detection. It stops short of distinguishing the tool from siblings like scan_secrets, whose surface the 'secret leak detection' phrase partially overlaps.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit when-to-use, when-not-to-use, or alternative routing guidance. An agent cannot tell from this description whether to call smart_diff or the sibling scan_secrets for a credential check, or whether estimate_context_cost is preferable for pure budget planning.

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