Skip to main content
Glama

delete_doc_range

Destructive

Deletes one or more content ranges from a Google Doc by start/end indices, applying deletions high-index-first so earlier positions stay valid; confirm indices first to avoid shifting errors.

Instructions

Delete one or more content ranges from a Google Doc.

All indices are interpreted as positions in the document before any of the deletions in this call. Deletions are applied high-index-first so earlier indices are not shifted by later ones.

Use get_doc_structure to obtain the correct start/end indices.

Args: doc_id: The Google Doc file ID. deletions: List of {"start_index": int, "end_index": int}. The range [start_index, end_index) is deleted (end_index is exclusive). Do not include the document's final newline (last endIndex - 1).

Returns: Confirmation with docId and count of deletions applied.

Note: Including a paragraph's trailing paragraph mark in the deleted range merges that paragraph into the next one, and the merged result inherits the next paragraph's style (e.g. deleting through a NORMAL_TEXT paragraph's newline when the following paragraph is HEADING_1 leaves the surviving content styled as HEADING_1). Text inserted afterward at that position silently picks up the same inherited style. Follow a paragraph-mark-inclusive delete with an explicit updateParagraphStyle (style_doc_range's named_style_type, or insert_softbreak_paragraph's named_style_type) rather than assuming the original style survived.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "doc_id": "<doc_id>",
      "deletions": "<deletions>"
    },
    "name": "delete_doc_range"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_idYes
deletionsYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the destructiveHint annotation: it explains index interpretation (positions before any deletion), the high-index-first application order that prevents shift bugs, the prohibition on touching the final newline, and the non-obvious style-inheritance side effect when a paragraph mark is deleted. This is exactly the pre-call hazard information an agent needs for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first line, followed by index semantics, prerequisites, args, returns, and a hazard note in a logical order. The Note is long and dense, but every sentence carries a behavior that cannot be inferred, so the length is justified rather than padding.

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 two-parameter destructive tool with a fully undocumented schema, the description supplies argument structure, ordering semantics, edge-case constraints, and follow-up remediation. Return values are summarized even though an output schema exists, leaving no substantive gap for correct invocation.

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

Parameters5/5

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

Schema coverage is 0% and the deletions items object is untyped (additionalProperties: true), so the description must carry the full burden. It does: doc_id is defined as the Google Doc file ID, and deletions is spelled out as a list of {start_index, end_index} objects with exclusive end semantics plus an explicit constraint on the final newline.

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?

States a specific verb and resource ('Delete one or more content ranges from a Google Doc') with clear scope: ranges of content, not whole files or text strings. This cleanly separates it from siblings such as insert_doc_text, write_doc_content, and delete_event.

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?

Explicitly names get_doc_structure as the prerequisite for obtaining valid start/end indices, and prescribes a follow-up (updateParagraphStyle via style_doc_range or insert_softbreak_paragraph) after a paragraph-mark-inclusive delete. It stops short of stating when to prefer a sibling over this tool (e.g., whole-document rewrites via write_doc_content), so it is strong but not fully bilateral.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools