Skip to main content
Glama

看单文件 git diff

piweb_git_diff
Read-only

View a file's complete Git patch to inspect changes, share it with an agent for edits, or verify modifications.

Instructions

看某个文件相对 git 的完整 patch。复制到会话里让 agent 改,或用来核查它的改动是否合理。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYes项目目录(仓库内)的绝对路径
pathYes目标文件的绝对路径
max_charsNopatch 截断长度,默认 30000

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.6/5.0
Behavior3/5

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

The readOnlyHint annotation already establishes this is a safe read operation, lowering the bar. The description adds that the output is a full patch, but does not disclose that the patch may be truncated at max_chars (only the schema hints at this), so it adds modest behavioral context beyond annotations.

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 short sentences, front-loaded with the core purpose before the usage hint. Efficient with essentially no filler, though the second sentence mixes two distinct use cases.

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 simple read-only inspection tool with no output schema, the description conveys the nature of the return value ('完整 patch') and its intended use. The only minor gap is not mentioning truncation behavior, which is left to the 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%, so cwd, path, and max_chars are already documented in the schema. The description contributes no additional parameter meaning, making the baseline 3 appropriate.

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 states a specific verb+resource: viewing the complete git patch of a single file ('看某个文件相对 git 的完整 patch'). This is clear and concrete, but it does not explicitly differentiate from siblings like piweb_git_status or piweb_read_file.

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

Usage Guidelines4/5

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

It gives two concrete usage contexts — copy the patch into a session so an agent can edit, or use it to verify that an agent's changes are reasonable. That is real when-to-use guidance, though it names no alternative tool or exclusion condition.

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