Skip to main content
Glama

studio_edit_file

Change a file of the open page, in one of two ways. With old_text and new_text: replace one exact piece of text, which must appear exactly once in the file (copy it from studio_get, what file, without the line numbers, with enough surrounding lines to make it unique). With content: write the whole file, or add content at its end with append=true; replacing an existing large file is refused: change it with old_text and new_text. manifest.json must stay one valid JSON object (studio_get, what doc, topic manifest). Nothing is saved before studio_save.

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": {
      "session_id": "<session_id>",
      "path": "<path>"
    },
    "name": "studio_edit_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesOne of the page's four files.
appendNoWith content: add it at the end of the file.
contentNoInstead of old_text and new_text: the whole file, or what append adds at its end.
new_textNoWith old_text: the text that replaces it.
old_textNoWith new_text: the exact text to replace, which must appear exactly once in the file. Copy it from studio_get (what file), without the line numbers.
session_idYesThe session_id studio_open_page returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=false, so safety posture is covered. The description still adds real behavioral context beyond them: the uniqueness constraint on old_text, that large-file replacement is actively refused, that manifest.json must remain one valid JSON object, and critically that nothing persists until studio_save.

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?

Front-loaded with the two-mode framing, then constraints, then the persistence caveat. Dense and every clause earns its place, though the parenthetical nesting makes a few sentences run long.

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?

A 6-parameter mutation tool with no output schema, and the description covers what an agent needs: valid invocation modes, the exclusive-or relationship between content and old_text/new_text, source-of-truth for old_text, format invariants, and the save step. Nothing critical is left to inference.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine semantics: append only has meaning alongside content, old_text must appear exactly once and be copied from studio_get without line numbers. That is more than a restatement of the field docs.

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?

States a specific verb and resource ("Change a file of the open page") and immediately enumerates the two modes of operation. An agent can tell this is a file-mutation tool distinct from studio_get (read) and studio_save (persist) without opening a schema.

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?

Explicitly routes between the two modes: old_text/new_text for a unique exact replacement, content for full-file writes, content+append=true for appends. It also names the fallback when a large-file replacement is refused ("change it with old_text and new_text") and names the prerequisite source sibling studio_get.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.