Skip to main content
Glama

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
NameRequiredDescriptionDefault
textYes
startYes
endYes
replacementYes

Implementation Reference

  • 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:]

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/agent-hanju/char-index-mcp'

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