Skip to content

doc_query

doc_query performs a full-text keyword search across all chunks of an indexed document and returns the matching sections. Use it when you know a keyword but not the section heading.

doc_query(doc_id="docs_ARCHITECTURE_md", keyword="rate limit")
doc_query(doc_id="abs_path_to_spec_yaml", keyword="authentication")
doc_query(doc_id="data_csv", keyword="Alice", limit=5)
ParameterTypeDefaultDescription
doc_idstringrequiredDocument ID from doc_list()
keywordstringrequiredKeyword or phrase to search for
limitnumber10Max matching chunks to return
  • You know a term appears in the document but not which section
  • Searching a large CSV for a specific row or value
  • Finding all mentions of a concept across a long spec
ToolUse when
doc_getYou know the section heading
doc_queryYou know a keyword and want to find where it appears
# Find all mentions of "idempotency" in the architecture doc
doc_query(doc_id="docs_ARCHITECTURE_md", keyword="idempotency")
→ Section 3.4: Payment API
→ Section 5.2: ADR-012 Idempotency Keys