Skip to main content
Glama
MIRAI Intelligence & Research MCP

MIRAI Intelligence & Research MCP

by Tarant336

Analyze a patch diff

patch_diff_analyze
Read-onlyIdempotent

Computes a line-based LCS unified diff between two workspace files, reporting added, removed, and context statistics plus semantic classification as security fix, refactor, or feature.

Instructions

Compute a real line-based LCS unified diff between two workspace files, with added/removed/context statistics and a semantic classification (security fix / refactor / feature). Returns diff hunks.

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": {
      "beforePath": "<beforePath>",
      "afterPath": "<afterPath>"
    },
    "name": "patch_diff_analyze"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxLinesNoPer-file line cap for the diff (default 2000).
afterPathYesPatched file (workspace-relative).
beforePathYesOriginal file (workspace-relative).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, non-destructive, closed-world behavior, so the bar is lower, and the description still adds real substance: the underlying algorithm (line-based LCS), the computed statistics, a semantic classification, and the fact that hunks are returned. It omits edge-case behavior such as missing paths, non-text/binary files, or whether the classification is heuristic, which keeps it from a 5.

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?

Two sentences, front-loaded with the core computation and followed by the return shape; almost no filler. It is slightly dense, packing inputs, statistics, classification, and return value into one clause-heavy sentence, but nothing is wasted.

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?

With no output schema, the description must cover the return value, and it does so by naming hunks, statistics, and classification. For a two-file read-only computation with fully described parameters, that is close to sufficient. Missing only failure modes for absent or non-diffable files.

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 all three parameters including the 2000-line default for maxLines are already documented in structured data. The description repeats the per-file line bound without adding syntax or format guidance beyond the schema. Baseline 3 is appropriate where 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?

States a specific verb and resource: computes a line-based LCS unified diff between two named workspace files, plus added/removed/context statistics and a semantic classification. That is far more concrete than a tautology. It stops short of a 5 because it never contrasts itself with the similarly scoped sibling firmware_patch_diff, leaving the agent to infer the split from names alone.

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?

There is no explicit when-to-use or when-not-to-use sentence, and no alternative tool is named. Usage is only implied by the scope constraint that both inputs must be workspace files and that the output is a textual diff. An agent can infer the scenario, but nothing routes it away from the sibling diff/root-cause tools.

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

Deploy Server

Other Tools