Skip to main content
Glama

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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:]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Delete' implies a destructive mutation, the description doesn't specify what happens to the modified text (whether it's returned, stored, or discarded), whether the operation is reversible, or any error conditions. The [start, end) notation suggests exclusive end indexing, but this isn't explicitly explained.

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 at just 6 words, with zero wasted language. It's front-loaded with the core action and immediately specifies the range format. Every word serves a purpose, making it easy to parse quickly.

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

Completeness3/5

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

Given that there's an output schema (which presumably documents return values), the description doesn't need to explain outputs. However, for a destructive mutation tool with 3 parameters and 0% schema coverage, the description is insufficient. It doesn't cover parameter meanings, error conditions, or behavioral details that would help an agent use it correctly alongside similar sibling tools.

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%, so the schema provides no parameter documentation. The description only mentions 'start' and 'end' parameters indirectly through the range notation, completely omitting the 'text' parameter. It doesn't explain what the 'text' parameter represents (input text to modify), what valid ranges are, or whether indices are zero-based or one-based.

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

Purpose4/5

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

The description clearly states the action ('Delete') and resource ('characters in range'), making the purpose immediately understandable. It specifies the range format [start, end) which adds precision. However, it doesn't explicitly distinguish this from sibling tools like 'replace_range' or 'insert_at_index', which also manipulate text ranges.

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. There are multiple sibling tools for text manipulation (replace_range, insert_at_index, extract_between_markers), but the description doesn't help an agent choose between them. It also doesn't mention prerequisites or constraints for using this deletion operation.

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

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