Skip to main content
Glama
orieg

orieg/gws-connector

gws.docs.replace_text

Destructive

Replace all literal occurrences of a specified substring in a Google Doc with replacement text. Supports case-sensitive matching and returns the count of changes applied.

Instructions

Replace all occurrences of a literal substring in a Google Doc. NOT regex — find is matched as a literal substring. match_case defaults to true. Returns the number of occurrences changed. This tool irreversibly modifies user content. Confirm intent with the user before calling it on documents you did not create in this session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
findYesThe literal substring to find
accountNoAccount label or email. Uses default if omitted.
replaceYesThe replacement text (may be empty to delete matches)
match_caseNoWhether the search is case-sensitive (default true)
document_idYesThe document ID
Behavior5/5

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

Beyond the annotations (destructiveHint=true, readOnlyHint=false), the description discloses that the tool 'irreversibly modifies user content', returns the number of occurrences changed, and clarifies literal substring matching behavior. These details add meaningful context about side effects and output that annotations do not provide. No contradiction with annotations.

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?

The description is concise and front-loaded, opening with the core operation. Every sentence earns its place: the regex caveat, match_case default, return value, irreversibility, and confirmation warning. No redundant filler or verbose explanations.

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 tool with 5 parameters (3 required), destructive annotations, and no output schema, the description adequately covers return value, safety, and key behavioral constraints. It addresses the irreversible nature and the importance of user confirmation, making it sufficient for an AI agent to use safely and correctly.

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?

The input schema already covers 100% of parameters with clear descriptions, including 'literal substring', 'default true' for match_case, and 'may be empty to delete matches'. The description repeats some of this information but does not add new parameter-level semantics beyond what the schema already states. Baseline of 3 is appropriate.

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 clearly states it 'Replace all occurrences of a literal substring in a Google Doc', giving a specific verb, resource, and scope. It also distinguishes from regex and implies a difference from insertion tools like gws.docs.insert_text, making it highly specific and unambiguous.

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?

The description provides clear context for when to use the tool (replacing literal substrings) and includes an explicit exclusion: 'NOT regex'. It also adds a usage caution about confirming intent on documents not created in the session. However, it does not name alternative tools or explicitly say when not to use it beyond the regex caveat, so it stops short of a full 5.

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/orieg/gws-connector'

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