Skip to main content
Glama

studio_edit_file

Replace one exact piece of text in a file of the open page. old_text must appear exactly once in the file: copy it from studio_read_file, without the line numbers, and include enough surrounding lines to make it unique. Nothing is saved before studio_save.

Input Schema

NameRequiredDescriptionDefault
pathYesOne of the page's four files.
new_textYes
old_textYes
session_idYesThe session_id studio_open_page returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare non-read-only, non-idempotent, non-destructive, so the description usefully adds the failure condition (old_text must appear exactly once) and the deferred-persistence model ('Nothing is saved before studio_save'). That is real context beyond the annotations, though it doesn't say what the tool returns or how a non-unique match surfaces.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, no filler, ordered from what the tool does to the precondition to the persistence caveat. Every sentence carries actionable information.

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 mutation tool with no output schema, the description covers the critical mechanics: unique-match requirement, where to source the text, and the save boundary. It leaves error reporting and confirmation of the applied edit unstated, which is a minor but real gap.

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 only 50% (path and session_id documented; old_text and new_text bare), so description compensation matters. The description does exactly that for old_text — uniqueness rule, source, line-number caveat, and how to disambiguate — while new_text is left to obvious inference.

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 precise verb and scope: 'Replace one exact piece of text in a file of the open page,' which is meaningfully narrower than the sibling studio_write_file. It doesn't explicitly name write_file as the alternative for whole-file replacement, so the differentiation is implied rather than stated.

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?

Gives concrete sourcing instructions ('copy it from studio_read_file, without the line numbers') and the uniqueness precondition, plus the workflow gate that nothing persists before studio_save. It stops short of saying when to prefer this over studio_write_file or studio_search_in_files.

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.