Skip to main content
Glama
FullContextInput MCP

FullContextInput MCP

by lukehemmin

write_file_diff

Modifies large code files by replacing a specified line range with new content, reading the existing file and optionally creating a backup.

Instructions

긴 코드(6000토큰 초과)를 diff 방식으로 수정합니다. 기존 파일을 읽고 지정된 라인 범위를 새로운 내용으로 교체합니다.

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": {
      "file_path": "<file_path>",
      "start_line": "<start_line>",
      "end_line": "<end_line>",
      "new_content": "<new_content>"
    },
    "name": "write_file_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
backupNo백업 파일 생성 여부 (기본값: true)
end_lineYes교체할 끝 라인 번호 (inclusive)
file_pathYes수정할 파일의 경로
start_lineYes교체할 시작 라인 번호 (1부터 시작)
new_contentYes교체할 새로운 코드 내용

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.4

TDQS

B3.4/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 the mechanism: it reads the existing file and replaces the specified line range, which tells the agent the original lines are overwritten. It says nothing about invalid ranges, encoding, or permissions, and the backup behavior is only in the schema, not the prose.

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 discriminating size threshold followed by the mechanism. The second sentence is somewhat redundant with the parameter descriptions but still earns its place as a one-glance summary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive file mutation with no annotations and no output schema, the definition covers the core mechanism and threshold but omits failure behavior and sibling routing. The schema is rich enough that parameter gaps are covered, leaving this adequate but not complete.

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 five parameters including backup and line numbering are already documented. The description reinforces the start/end range semantics but adds no format or edge-case detail beyond the schema, so the baseline of 3 applies.

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 names a specific operation and resource: modify a file by diff, replacing a given line range. The 6000-token threshold implicitly distinguishes it from whole-file writes, but it never names write_file_complete, so the agent must infer the boundary rather than being told.

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?

The size condition ('over 6000 tokens') gives implied when-to-use guidance, which is more than nothing. However there is no explicit 'use write_file_complete for smaller files' routing and no when-not guidance, so the alternative must be guessed from sibling names.

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