Skip to main content
Glama
neu-sandbox-mcp

neu-sandbox-mcp

Official
by neutree-ai

Replace Text in Sandbox Files

sandbox_replace_contents

Replace text inside sandbox files in place and return per-file replacement counts to verify each edit. If counts are unavailable, read the file back to confirm changes.

Instructions

Replace text inside files, editing in place instead of rewriting the whole file. Returns a replaced_count per file — 0 means the old text was not found, so check it rather than assuming the edit landed. If detail_available is false the sandbox runtime is too old to report counts: the replacement still happened, but you have to read the file back to confirm what changed.

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": {
      "sandbox_id": "<sandbox_id>",
      "entries": "<entries>"
    },
    "name": "sandbox_replace_contents"
  }
}

Input Schema

NameRequiredDescriptionDefault
entriesYesReplacements to apply
sandbox_idYesID of the target sandbox

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations present, the description carries the full behavioral burden and does substantial work: it discloses the per-file return value, warns that replaced_count=0 signals a miss rather than a silent no-op, and explains the detail_available=false degraded path plus the read-back remedy. Not covered are matching semantics (literal vs regex), what happens when a path does not exist, and whether the entries list is applied atomically or sequentially when multiple entries touch the same file.

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?

Three tight sentences with the core action front-loaded and the verification guidance following in priority order. Every sentence carries operational value, though the return-value material could be compressed slightly since no output schema exists to hold it.

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 mutation tool with no annotations and no output schema, the description supplies the otherwise-missing return semantics (replaced_count, detail_available) and a verification procedure, which is the main gap it needed to close. Residual gaps are error/edge behavior (missing file, unmatched text handling beyond the count hint) rather than anything blocking a correct call.

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 path, old_content, new_content, entries, and sandbox_id are already documented, making 3 the baseline. The description adds interpretive meaning for one outcome ('0 means the old text was not found') but says nothing about how multiple entries interact, ordering, or whether old_content matching is literal or pattern-based.

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 ('Replace text inside files') and immediately contrasts the mechanism against the obvious sibling behavior: 'editing in place instead of rewriting the whole file,' which reads as a direct distinction from sandbox_write_files. It stops short of explicitly naming the alternative tool, so an agent must infer the mapping from sibling names.

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 phrase 'editing in place instead of rewriting the whole file' implies when this is preferable to a full-file write, but no tool is named and there is no explicit when-not-to-use guidance (e.g., multiple scattered edits, non-literal matching, whole-file rewrites). Usage is implied rather than stated.

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