find_doc_text
Find every occurrence of a text substring and return its index ranges.
readGoogle Sheets, Docs & Drive
Use this before calling update_doc_text_style to apply styles to specific words/phrases without computing indices by hand.
Call it
In an AI client (MCP)
{
"name": "find_doc_text",
"arguments": {
"documentId": "<documentId>",
"needle": "<needle>"
}
}From code (Tool API)
curl -X POST https://api.sellersheetai.com/api/v1/tools/find_doc_text \
-H "Authorization: Bearer $SELLERSHEET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"documentId":"<documentId>","needle":"<needle>"}'Early access — the Tool API is open on request, contact us.
Arguments
| Name | Type | Description |
|---|---|---|
documentIdrequired | string | the Google Docs document ID. |
needlerequired | string | Literal text to find (not regex). |
matchCase | boolean | If True, case-sensitive match.Default: false |
Result
Every tool answers {notification, data, human_action}; data carries:
- { matches: [{startIndex, endIndex, text}, ...], count: N }
Gotchas
- Searches top-level body paragraphs one styled run at a time: text inside tables, headers or footers, or a phrase whose words carry different styles (e.g. half bold), returns no match — replace_doc_text still reaches it.