Skip to main content
Glama
taylorwilsdon

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

Find and Replace Doc

find_and_replace_doc
Destructive

Search and replace specific text in a Google Doc without calculating indices. Update placeholders, words, or phrases throughout the document safely.

Instructions

Finds and replaces text throughout a Google Doc. No index calculation required.

This is the safest way to update specific text in a document because it does not require knowing any indices. Use this tool when you need to:

  • Replace placeholder text (e.g., {{TITLE}}) with real content

  • Update specific words or phrases throughout the document

  • Make targeted text changes without risk of index errors

For building documents from scratch, consider inserting text with unique placeholders via batch_update_doc, then using this tool to replace them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNoOptional ID of the tab to target
find_textYesText to search for
match_caseNoWhether to match case exactly
document_idYesID of the document to update
replace_textYesText to replace with
user_google_emailYesUser's Google email address

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.28.0
    • removedInput schema / properties / tab_id / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / tab_id / type
      Added value: +"string"
  2. Addedv1.0.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already signal mutation/destructiveness; the description adds behavioral context by explaining this is a no-index, targeted-replacement operation and frames it as the 'safest' update path because it avoids index errors. It could have explicitly said the edit is applied directly/irreversibly, but the destructiveHint is already present.

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?

The main point is front-loaded in the first sentence and the usage scenarios are scannable bullets. It is still slightly redundant, repeating the no-indexes idea three times ('No index calculation required', 'does not require knowing any indices', 'without risk of index errors').

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

Completeness4/5

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

For a mutation tool with an output schema, the description covers what it does, when to use it, and which sibling to reach for when building documents from scratch. It does not elaborate on tab_id/match_case semantics, but the schema already describes those and the use cases suffice.

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?

Schema description coverage is 100%, so the parameters are already fully documented and the description carries no per-parameter burden. The 'No index calculation required' note is a useful high-level hint, but it does not add meaning to any specific parameter beyond the schema.

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?

Opens with a specific verb+resource ('Finds and replaces text throughout a Google Doc') and immediately adds a distinguishing constraint ('No index calculation required'). The listed use cases make the tool's scope concrete and separate it from sibling tools like modify_doc_text or batch_update_doc.

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

Usage Guidelines5/5

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

Explicitly enumerates three when-to-use scenarios and provides an alternative path for document construction ('consider inserting text with unique placeholders via batch_update_doc'). This gives an agent both inclusion and exclusion guidance.

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