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)

tools/call
{
  "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

NameTypeDescription
documentIdrequiredstringthe Google Docs document ID.
needlerequiredstringLiteral text to find (not regex).
matchCasebooleanIf 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.

On this page

Actions

View as Markdown

Ask an assistant

Ask ChatGPTAsk Claude