Skip to main content
Glama

Find text in a Google Doc

find_text
Read-only

Locate every occurrence of a phrase in a Google Doc and return exact start/end indexes, paragraph style, and table status for precise index-based edits.

Instructions

Find every occurrence of a literal phrase in a Google Doc (including text inside table cells) and return the exact startIndex/endIndex of each match, its paragraph style, whether it is in a table, and a short context snippet. Use this to get exact indexes for index-based tools such as format_text, delete_text, insert_link or insert_text. Matching is literal (no wildcards or regular expressions), case-insensitive unless matchCase is true, and a match cannot span paragraphs or include the paragraph’s line break. Indexes are only valid until the document is edited: when applying several edits, work from the last occurrence backwards.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe exact text to find.
matchCaseNoMatch upper/lower case exactly (default: case-insensitive).
documentIdYesThe Google Docs document ID (the part between /d/ and /edit in the document URL). A full Google Docs URL is also accepted.
maxResultsNoMaximum number of occurrences to return (1-500). totalMatches always reports the full count.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds substantive behavior beyond that: literal matching with no wildcards/regex, case-insensitivity unless matchCase is true, matches cannot span paragraphs or include the line break, and indexes are invalidated by subsequent edits. These are exactly the failure modes an agent would otherwise hit blindly.

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?

Purpose and return shape come first, then routing to sibling tools, then matching caveats and the edit-order rule. It is dense but every sentence carries actionable information with no filler.

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?

There is no output schema, so the description correctly compensates by enumerating the return fields (startIndex/endIndex, paragraph style, table membership, context snippet). Combined with the literal-match and index-lifetime caveats, an agent has everything needed to call it and use the result safely.

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 100%, so the baseline is 3; the description still adds meaning by explaining that matching is literal and case-insensitive unless matchCase is true, clarifying the semantics of that flag. It adds nothing further about maxResults, which the schema already covers via totalMatches.

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 states a specific verb and resource ('Find every occurrence of a literal phrase in a Google Doc') and immediately delimits scope ('including text inside table cells'). It also enumerates what is returned, so the agent knows exactly what this tool produces versus sibling readers like get_document.

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?

It explicitly names the downstream consumers ('index-based tools such as format_text, delete_text, insert_link or insert_text'), which tells the agent when to reach for find_text instead of replace_text. It also gives an operational rule for multi-edit workflows: work from the last occurrence backwards.

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