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

Replace text in Google Docs safely without index calculation. Specify document ID, find text, and replacement text to update placeholders or phrases.

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
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the mutating nature is known. The description adds useful context by explaining that it requires no index calculation, making it the 'safest way' for targeted updates. It also indicates the replacement happens 'throughout' the document, implying all occurrences. It does not explicitly mention side effects like replacement counts, but this is not required given the output schema exists.

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 description is well-structured: a lead sentence states the core function, followed by a bulleted list of use cases, and a closing note about an alternative tool. Every sentence earns its place and the length is appropriate for the tool's clarity. It could be slightly tighter, but it remains concise and scannable.

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?

Given the presence of an output schema and the 100% param coverage, the description provides sufficient context for a Google Doc find-and-replace operation. It covers the core behavior, when to use it, and an alternative for building documents from scratch. It does not mention edge cases like what happens if find_text is absent, but the output schema likely conveys that, making the description reasonably complete.

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

Parameters4/5

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

With 100% schema description coverage, the baseline is 3. The description adds semantic value by providing a concrete example: replacing placeholder text like '{{TITLE}}'. This helps an agent understand that find_text can be a template variable and replace_text its substitution, enriching the parameter meaning beyond the schema's simple 'Text to search for' and 'Text to replace with'.

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 opens with 'Finds and replaces text throughout a Google Doc,' which clearly states the verb, resource, and scope. It further distinguishes itself from siblings by highlighting 'No index calculation required' and explicitly contrasts with batch_update_doc for building documents. This makes the purpose unmistakable and differentiated.

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?

The description provides explicit use cases: replacing placeholders, updating specific words/phrases, and making targeted changes without index errors. It also states when not to use it (building documents from scratch) and recommends an alternative approach involving batch_update_doc. This is exactly the kind of when-to-use guidance expected.

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/taylorwilsdon/google_workspace_mcp'

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