Skip to main content
Glama

find_in_doc

Read-onlyIdempotent

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

NameRequiredDescriptionDefault
limitNo
queryYes
doc_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / limit / maximum
      Added value: +10
    • addedInput schema / properties / limit / minimum
      Added value: +1
  2. Added

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent annotations, it discloses non-obvious matching behavior: OR rather than AND semantics, title-term suppression, down-weighting of generic words, stop-word queries returning count 0 with a hint, and missing_terms/matched_terms reporting. It also explains that offset is absolute in the page body so a follow-up get_doc lands correctly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the one-line purpose and the routing decision before mechanics. Although long, each block (Args, matching semantics, returns) carries information an agent needs to call it correctly; nothing is redundant with annotations or schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, yet the description still usefully explains count vs returned semantics, heading provenance, and offset meaning. Combined with matching rules and parameter guidance, an agent has everything needed to invoke and interpret results without trial and error.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and does: doc_id accepts a search_docs id or page slug, query is a concept not a product name (with concrete examples and the title-term noise warning), and limit is bounded 1-10 with default 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first line states a precise verb and scope: locate a passage *inside* one manual, without paging through it. It is immediately distinguishable from search_docs (cross-document discovery) and get_doc (page retrieval) by the 'inside one manual' framing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says to use this after search_docs when you need a table/command/error code, notes it applies even to short documents, and gives a direct exclusion: 'Prefer this over repeatedly calling get_doc with increasing offsets.' The alternatives (search_docs, get_doc) are named with the condition that selects each.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.