Skip to main content
Glama
gworkspace-mcp
by ctschak

Find text and get its index ranges

docs_find

Locate exact text in a document and return index ranges for each match, providing measured indices for formatting or deletion instead of guessed positions.

Instructions

Locate exact text and return document index ranges for each match. This is the safe way to obtain indices for docs_format or docs_delete — they are measured now rather than guessed, and matches spanning formatting boundaries are handled. Indices are valid only until the next edit.

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": {
      "document": "<document>",
      "text": "<text>"
    },
    "name": "docs_find"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabNoTab id or title, for documents with several tabs. Reads default to the first tab; writes to a multi-tab document REQUIRE this rather than guessing. Get ids from docs_describe.
textYesExact text to locate.
limitNoMaximum matches to return. Default 50.
accountNoGoogle account to act as. Optional when one is authorised or a default is set.
documentYesDocument URL or file id. Both accepted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does add real behavioral context: matches spanning formatting boundaries are handled, and critically, returned indices are valid only until the next edit — a staleness caveat the agent cannot get anywhere else. It doesn't say what happens on zero matches or whether matching is case-sensitive.

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 tight sentences: purpose first, then workflow value, then the validity caveat. No filler, no restating of the tool name, and the most actionable constraint (index staleness) is placed where it will be read before acting.

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?

For an unannotated, output-schema-less lookup tool with five fully documented params, the description covers purpose, downstream consumers, and the main correctness hazard. Remaining gaps — case sensitivity, no-match behavior, and the shape of returned ranges — are minor but real for an agent that must act on the indices.

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 description coverage is 100%, so document, text, tab, limit, and account are all self-documenting. The description adds no meaning beyond the schema — for example, it does not clarify whether 'exact text' is case-sensitive or how limit interacts with the returned range list. Baseline 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?

States a specific verb and resource ('Locate exact text') plus the exact return ('document index ranges for each match'), which distinguishes it from docs_read (content retrieval) and docs_replace_text (mutation). An agent can tell immediately that this is an index-lookup tool, not a read or edit tool.

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?

Explicitly routes the agent: use this to obtain indices before calling docs_format or docs_delete, and notes that measured indices beat guessed ones. It does not name a when-not-to-use case (e.g., that docs_read is the choice when only text content is wanted), so it falls just short of full alternative coverage.

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