replace_range
Replace specific character ranges in text by specifying exact start and end positions to modify content precisely.
Instructions
Replace characters in range [start, end) with new text.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| start | Yes | ||
| end | Yes | ||
| replacement | Yes |
Implementation Reference
- char_index_mcp/server.py:174-181 (handler)The handler function for the 'replace_range' tool. It takes original text, start and end indices (inclusive start, exclusive end), and replacement string, then performs the string slicing and concatenation to replace the specified range.def replace_range( text: Annotated[str, "Original text"], start: Annotated[int, "Starting index (inclusive)"], end: Annotated[int, "Ending index (exclusive)"], replacement: Annotated[str, "Text to replace with"] ) -> str: """Replace characters in range [start, end) with new text.""" return text[:start] + replacement + text[end:]