Skip to main content
Glama

replace_content

Replace text patterns in files using literal or regex matching to modify code content within the Serena coding toolkit.

Instructions

Replace pattern in file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relative_pathYes
needleYes
replYes
modeYes
allow_multiple_occurrencesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

Annotations provide readOnlyHint=false, indicating this is a mutation tool. The description confirms this with 'Replace', which aligns with the annotation. However, the description adds minimal behavioral context beyond what annotations already provide—it doesn't mention what happens if the file doesn't exist, if replacements are destructive, if there are permission requirements, or what the output might contain. For a mutation tool with only basic annotations, more behavioral disclosure is needed.

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?

The description is extremely concise with a single sentence 'Replace pattern in file.' It's front-loaded and wastes no words, making it easy to parse quickly. Every word contributes directly to the core purpose without unnecessary elaboration.

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

Completeness2/5

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

Given the tool's complexity (5 parameters, mutation operation, 0% schema coverage) and the presence of an output schema (which might help with return values), the description is incomplete. It doesn't provide enough context for safe and effective use—missing details on parameter meanings, behavioral implications, and differentiation from siblings. The output schema might cover return values, but the description itself lacks essential operational context.

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

Parameters2/5

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

Schema description coverage is 0%, meaning none of the 5 parameters have descriptions in the schema. The description 'Replace pattern in file' only vaguely hints at parameters like 'needle' (pattern) and 'repl' (replacement), but it doesn't explain their semantics, the 'mode' enum options ('literal' vs. 'regex'), or the 'allow_multiple_occurrences' flag. The description fails to compensate for the lack of schema documentation, leaving parameters largely unexplained.

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

Purpose3/5

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

The description 'Replace pattern in file' states a clear verb ('Replace') and resource ('pattern in file'), but it's somewhat vague about what exactly gets replaced. It doesn't distinguish this tool from potential siblings like 'edit_memory' or 'rename_symbol' that might also involve content modification. The purpose is understandable but lacks specificity about scope and differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'edit_memory', 'write_memory', and 'rename_symbol' that might involve content changes, there's no indication of when 'replace_content' is appropriate (e.g., for pattern-based replacements in files vs. direct memory editing). No exclusions or prerequisites are mentioned.

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

Install Server

Other Tools

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/ryota-murakami/serena'

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