Skip to main content
Glama

drive_replace

Replace every occurrence of a text in a Google Doc (all its tabs) in the registered Google Drive folders. Answers how many were replaced; 0 means the text was not found and nothing changed. To change a spreadsheet use drive.update_range.

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": {
      "file": "<file>",
      "find": "<find>",
      "replace": "<replace>"
    },
    "name": "drive_replace"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesDrive id or pasted link of a Google Doc.
findYesThe text to look for.
replaceYesWhat to put instead (empty removes the text).
match_caseNoMatch upper and lower case exactly (default true).
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations cover the safety profile, and the description adds real context beyond them: replacement spans all tabs, it is folder-scoped, and the return value is a count where 0 explicitly means nothing changed. It stops short of saying whether the edit is reversible or requires edit permission on the doc, which matters for a mutation tool.

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?

Three compact sentences, each doing distinct work: what it does, what it returns, and where to go instead. The key behavior (count returned, 0 = no change) is front-loaded.

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?

With no output schema, the description correctly explains the return value, and a 5-parameter tool with full schema coverage is otherwise self-documenting. Minor gaps remain around permissions and whether prior text is recoverable after a replacement.

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 coverage is 100%, so every parameter is already documented, including empty-string removal and the match_case default. The description adds only scope framing (all tabs, registered folders) rather than meaning for individual parameters, so the baseline of 3 applies.

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 a specific verb and resource: replace every occurrence of text in a Google Doc across all its tabs, scoped to registered Drive folders. It also names the sibling it is not for (spreadsheets -> drive.update_range), so an agent can separate it from drive_update_range without opening either schema.

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 a clear exclusion plus the correct alternative for spreadsheet edits. It does not address other adjacent operations (create_doc, append, read), but the when-to-use context for text replacement is unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.