Skip to main content
Glama
Platano78

Smart-AI-Bridge

by Platano78

modify_file

Edit existing files by describing changes in natural language. Generates a unified diff for approval before writing, with optional direct write and backup safety.

Instructions

Edit an existing file by describing the change in natural language. The local LLM reads the file, applies the edit using SEARCH/REPLACE blocks (with a size-ratio safety net that refuses writes <50% of the original), and returns a unified diff for Claude to approve (review:true, default) or writes directly (review:false). Use for non-trivial edits where the AI does the work. For a known string→string replacement Claude can do itself, use native Edit. For writing a fully-specified content string to a file, use write_files_atomic. For the same instruction across MANY files, use batch_modify. For symbol renames + cross-file reference updates, use refactor. ⚠️ DESTRUCTIVE when review:false: writes directly to filePath. A backup at <path>.backup.<timestamp> is created unless backup:false is also passed (a warning is logged in that case). dryRun:true produces the diff without writing. Returns: shape depends on mode. review (default): {success, status:'pending_review'|'pending_review_truncated', filePath, diff, modifiedContent, summary, stats, warnings, was_truncated, approval_options, retry_attempts}. dryRun: {success, status:'dry_run', filePath, diff, summary, stats, warnings, backend_used, processing_time}. auto-write: {success, status:'written', filePath, diff, summary, stats, backupCreated, backend_used, processing_time, tokens_saved}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
optionsNo
filePathYesPath to the file to modify
instructionsYesNatural language edit instructions (e.g., "Add rate limiting to the login function")

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv2.14.0
    • changedInput schema / properties / options / properties / backend / enum
      Previous value: -[
      -  "auto",
      -  "local",
      -  "deepseek",
      -  "glm",
      -  "qwen3",
      -  "gemini",
      -  "groq"
      -]New value: +[
      +  "auto",
      +  "local",
      +  "deepseek",
      +  "glm",
      +  "gemini",
      +  "groq"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / options / properties / backend / enum
      Previous value: -[
      -  "auto",
      -  "local",
      -  "deepseek",
      -  "qwen3",
      -  "gemini",
      -  "groq"
      -]New value: +[
      +  "auto",
      +  "local",
      +  "deepseek",
      +  "glm",
      +  "qwen3",
      +  "gemini",
      +  "groq"
      +]
  3. Addedv1.3.2

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries full responsibility. It fully discloses destructive behavior (review:false writes directly, backup unless backup:false), the size-ratio safety net, the dry-run mode, and the exact return shapes for all three modes (review, dryRun, auto-write). Nothing is left to inference and it contradicts no structured data.

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?

The description is long but every sentence earns its place: purpose, safety net, usage routing, destructive warning, backup behavior, and return shapes. It leads with the core statement and then layers specifics. While dense, the structure (modes, return shapes) keeps it navigable.

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

Completeness5/5

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

For a tool with 2 required params, 3 modes, a safety net, and no output schema, the description covers every angle: when to use, what it does, how it behaves in each mode, what the response looks like, and the destructive caveats. Nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already describes both required parameters and each option. The description adds valuable behavioral context beyond schema – e.g., the <50% size-ratio refusal, the meaning of 'pending_review' statuses, and the backup timestamp naming. It doesn't reinvent parameter docs but enriches them with operational detail.

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

Purpose5/5

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

The description immediately states 'Edit an existing file by describing the change in natural language' – a clear verb+resource. It also names four sibling tools to differentiate (native Edit, write_files_atomic, batch_modify, refactor) with specific conditions for each, making selection unambiguous.

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

Usage Guidelines5/5

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

It explicitly says 'Use for non-trivial edits where the AI does the work' and provides a battery of alternatives: native Edit for known string replacements, write_files_atomic for fully-specified content, batch_modify for many files, refactor for symbol renames. This is textbook when/when-not guidance.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Platano78/Smart-AI-Bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server