Skip to main content
Glama
Google Workspace MCP Server

Google Workspace MCP Server

by akilja24

find_and_replace_doc

Finds and replaces text throughout a Google Doc, with optional case-sensitive matching, and returns the number of replacements made.

Instructions

Finds and replaces text throughout a Google Doc.

Args: user_google_email: User's Google email address document_id: ID of the document to update find_text: Text to search for replace_text: Text to replace with match_case: Whether to match case exactly

Returns: str: Confirmation message with replacement count

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": {
      "user_google_email": "<user_google_email>",
      "document_id": "<document_id>",
      "find_text": "<find_text>",
      "replace_text": "<replace_text>"
    },
    "name": "find_and_replace_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
find_textYes
match_caseNo
document_idYes
replace_textYes
user_google_emailYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.13.1

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose that replacement is document-wide and that a replacement count is returned, but it says nothing about permissions required, whether changes are reversible, or what happens with zero matches or invalid document IDs.

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?

Front-loaded one-line purpose followed by compact Args and Returns sections; no filler sentences. The Returns block is redundant given an output schema exists, but it costs little.

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?

For a document-mutating tool with no annotations, the definition should say more about side effects, match behavior (all occurrences vs first), and failure modes. The output schema covers the return value, and all parameters are at least named, so it is viable but with clear gaps.

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?

Schema description coverage is 0%, so the description must compensate, and it does list every one of the five parameters with a short meaning. The glosses are minimal ('Text to search for', 'ID of the document to update') and add little beyond the parameter names, but coverage of all params is a real contribution.

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?

States a specific verb and resource: 'Finds and replaces text throughout a Google Doc.' The word 'throughout' conveys whole-document scope, which distinguishes it in spirit from targeted siblings like modify_doc_text, but no sibling is named explicitly.

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

Usage Guidelines3/5

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

Usage is only implied by the purpose; the description never says when to prefer this over modify_doc_text or batch_update_doc, nor does it state prerequisites such as needing edit access or handling of multiple matches. The 'throughout' phrasing gives a hint about global versus targeted replacement, but nothing more.

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