find_in_doc
Locate a passage inside one manual, without paging through it.
Use this after ``search_docs`` whenever you need a specific table, command
or error code rather than the whole page — including short documents,
because manuals commonly open with a preamble and page 1 rarely answers a
question. It returns the exact ``offset`` of each match, so one
``get_doc(doc_id, offset=...)`` lands on the right section.
Prefer this over repeatedly calling ``get_doc`` with increasing offsets.
Args:
doc_id: id from ``search_docs`` (also accepts the page slug).
query: the *concept*, not the product name — e.g. "波特率" or
"急停 接线". Terms that already appear in this page's title are
ignored, because ``search_docs`` picked the page by them; passing
the product name again only adds noise. Generic words that appear
in nearly every manual are down-weighted, so one distinctive term
is enough.
limit: 1-10 passages, default 5.
Matching is OR, not AND: a passage is returned when it contains at least
one term with enough weight. Terms that are absent from this page therefore
do **not** force a zero result — check ``missing_terms`` to see which of
your words this page never mentions, and ``matched_terms`` for the ones it
does. A query made only of stop words (or nothing) returns ``count: 0``
with a hint.
Returns JSON: {doc_id,title,space,url,chars,query,count,returned,
matched_terms,missing_terms,hits:[{offset,heading,score,matched,excerpt}],
hint}. ``count`` is the total number of matched passages; ``returned`` is
how many are in ``hits`` (capped by ``limit``). ``heading`` is the nearest
heading above the passage; ``offset`` is absolute in the page body.
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": {
"doc_id": "<doc_id>",
"query": "<query>"
},
"name": "find_in_doc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| doc_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |