Skip to main content
Glama

slice_diff

Slices unified diffs by omitting lockfiles and trimming context lines, reducing token usage by up to 80% while preserving essential changes.

Instructions

Slices unified diffs, omitting lockfiles and minimizing context lines to reduce tokens by up to 80%.

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": {
      "diff": "<diff>"
    },
    "name": "slice_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
diffYesRaw git diff text
max_contextNoMaximum surrounding context lines (default: 2)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.8.4

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two concrete behaviors beyond the schema: lockfile entries are dropped and context lines are minimized, with an advertised token savings of up to 80%. It stops short of stating the return shape, whether the transform is lossy for the diff's semantic content, or how malformed/non-diff input is handled.

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?

A single sentence with no filler: the action, the excluded content, the context behavior, and the payoff are all front-loaded. Every clause carries information an agent can use.

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 two-parameter, single-purpose transform with full schema coverage and no output schema, the description covers what matters: what is processed, what is stripped, and why. The main residual gap is the output format, which an agent can reasonably assume is the sliced diff text.

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 both parameters are already documented, and the description's "minimizing context lines" merely echoes the max_context parameter without adding format or edge-case guidance. Baseline 3 applies since the schema does the heavy lifting.

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?

"Slices unified diffs" gives a specific verb plus resource, and the added clause clarifies the transformation goal (token reduction). It does not name or contrast any sibling tool, so an agent must infer that this is the diff-specific variant of the compaction family, but the resource is distinctive enough to be identifiable.

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

Usage Guidelines3/5

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

Usage is only implied: the agent can infer it should call this when holding raw git diff text and wanting fewer tokens. There is no explicit when-to-use statement, no mention of when it is inappropriate (e.g. non-diff text), and no pointer to alternative compaction tools like compact_conversation or compress_prompt.

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