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)Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
doc_id | string | required | Document ID from doc_list() |
keyword | string | required | Keyword or phrase to search for |
limit | number | 10 | Max matching chunks to return |
When to use
Section titled “When to use”- 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
Difference from doc_get
Section titled “Difference from doc_get”| Tool | Use when |
|---|---|
doc_get | You know the section heading |
doc_query | You know a keyword and want to find where it appears |
Example
Section titled “Example”# Find all mentions of "idempotency" in the architecture docdoc_query(doc_id="docs_ARCHITECTURE_md", keyword="idempotency")→ Section 3.4: Payment API→ Section 5.2: ADR-012 Idempotency Keys