Skip to main content
Glama

Delete a text range

delete_range
Destructive

Deletes content in a Google Doc by specifying start and end indexes. Use fresh indexes from read_document_text because deletions shift later positions.

Instructions

Deletes the content in [start_index, end_index) — text, inline images, whole tables or any mix, as long as the range does not cut across a table cell boundary. Get fresh indexes from read_document_text first; every delete shifts all later indexes down. Deleting a paragraph's trailing newline merges it with the next paragraph. The tab's final newline cannot be deleted. This is final — there is no undo through the API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNoTab to target (from list_tabs). Omit for the first/only tab.
end_indexYesEnd of the range to delete (exclusive).
segment_idNoHeader/footer/footnote segment id (from get_document). Omit for the document body.
document_idYesThe document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output.
start_indexYesStart of the range to delete (inclusive).
Behavior5/5

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

The description goes well beyond the annotations: it discloses that deletions are irreversible, that indexes shift after every delete, that deleting a trailing newline merges paragraphs, and that the tab's final newline cannot be deleted. These are critical behavioral details not captured by destructiveHint or readOnlyHint.

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 compact and front-loaded with the core operation, then packed with only high-value caveats. Every sentence contributes unique operational information, with no filler or repetition of schema content.

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?

For a destructive mutation tool with no output schema, the description covers the full set of needed constraints: valid range contents, table boundary restriction, index refresh requirement, shift behavior, merge behavior, an exception, and irreversibility. An agent has enough information to invoke this tool correctly and safely.

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

Parameters3/5

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

The input schema already documents all five parameters with 100% coverage. The description adds useful context about start/end index semantics and indexing shifts, but it does not substantially clarify tab_id, segment_id, or document_id beyond what the schema already states. Baseline 3 is appropriate.

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 the operation ('Deletes the content in [start_index, end_index)') and the resource type (text range), and adds concrete scoping details like inline images, whole tables, and the table-cell-boundary restriction. This makes it easy to distinguish from sibling edit tools like insert_text or replace_range.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit operational guidance: fetch fresh indexes from read_document_text first, index shifting behavior, the final-newline exception, and the no-undo warning. It does not explicitly name an alternative tool for delete-like operations, but the prerequisite and exclusions are clear enough for correct use.

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/A1-x-Tech/mcp-google-docs'

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