Skip to main content
Glama
Facets-cloud

Facets Module MCP Server

by Facets-cloud

edit_file_block

Apply surgical edits to specific text blocks in files by finding and replacing exact strings, ensuring precision and safety.

Instructions

Apply surgical edits to specific blocks of text in a file. Make Sure you have Called FIRST_STEP_get_instructions first before this tool.

Makes precise changes to files by finding and replacing exact text matches. This is safer than rewriting entire files.

RESTRICTIONS:

  • Cannot edit outputs.tf files - use write_outputs tool instead

  • Cannot edit facets.yaml files - use write_config_files tool instead

Best practices:

  • Include enough context in old_string to make it unique

  • Use expected_replacements=1 for safety (default)

  • For multiple replacements, specify the exact count expected

Args: file_path (str): Path to the file to edit (must be within working directory) old_string (str): Exact text to find and replace (include context for uniqueness) new_string (str): Replacement text expected_replacements (int): Expected number of matches (default: 1, prevents unintended changes)

Returns: str: JSON formatted response with success status, message, and optional error details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
old_stringYes
new_stringYes
expected_replacementsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations provided; description fully carries burden by explaining find/replace behavior, safety aspects, default expected_replacements, and JSON return format with success/error details.

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?

Well-structured with initial summary, important prerequisite callout, behavioral description, restrictions in list, best practices, and formatted Args section. Every sentence adds value without redundancy.

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?

Given no annotations, zero schema descriptions, and 4 parameters, the description covers purpose, usage, constraints, parameters, and return format sufficiently for an editing tool.

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

Parameters5/5

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

Schema coverage is 0%, but description adds comprehensive meaning for each parameter: file_path includes directory constraint, old_string includes uniqueness advice, new_string is clear, expected_replacements explains default and safety purpose.

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 clearly states it applies surgical edits to text blocks in files and distinguishes from alternatives like write_outputs and write_config_files by listing restrictions.

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?

Provides explicit prerequisites (call FIRST_STEP_get_instructions first), when not to use (cannot edit outputs.tf or facets.yaml), and alternatives (use write_outputs or write_config_files). Also includes best practices for usage.

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/Facets-cloud/facets-module-mcp'

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