delete_range
Remove characters from text by specifying exact start and end positions to delete text segments with character-level precision.
Instructions
Delete characters in range [start, end).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| start | Yes | ||
| end | Yes |
Implementation Reference
- char_index_mcp/server.py:163-170 (handler)The handler function implementing the 'delete_range' tool logic. It deletes the characters in the specified range [start, end) from the input text using Python string slicing and concatenation. The @mcp.tool() decorator registers this function as an MCP tool.@mcp.tool() def delete_range( text: Annotated[str, "Original text"], start: Annotated[int, "Starting index (inclusive)"], end: Annotated[int, "Ending index (exclusive)"] ) -> str: """Delete characters in range [start, end).""" return text[:start] + text[end:]