Skip to main content
Glama

doc_locate

Read-onlyIdempotent

Finds relevant PDF pages and snippets for a query using lexical and page-reference signals, so agents can target page reads without LLM calls.

Instructions

Locate the most relevant pages and snippets in a PDF without calling any LLM (<=1,200 tokens). Combines lexical BM25-RRF, printed page references, statement-intent boosting, and table continuations. Call after doc_outline before reading pages.

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": {
      "query": "<query>"
    },
    "name": "doc_locate"
  }
}

Input Schema

NameRequiredDescriptionDefault
kNoNumber of top candidate pages to return (1–10).
pathNoPath to a PDF inside allowed --root directories (optional if doc_id is supplied).
queryYesSpecific search query containing key entities, metrics, table names, or clause terms.
doc_idNoPreviously opened doc_id returned by doc_outline.
page_rangeNoOptional [start_page, end_page] 1-based physical page range to restrict search.
snippet_charsNoMaximum character length of each returned preview snippet.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds meaningful behavioral context beyond that: no LLM calls, a token cap (<=1,200 tokens), and the retrieval methods used (BM25-RRF, page references, intent boosting, table continuations). It does not detail return format or auth needs, but with annotations covering safety, this is a solid addition.

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

Conciseness4/5

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

Three sentences, front-loaded with the core action and token budget. The algorithm list is dense but earns its place by explaining how relevance is computed. No wasted words.

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

Completeness4/5

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

For a 6-parameter search tool with full schema coverage and annotations, the description is largely complete: it states the purpose, token budget, algorithm, and workflow position. It could say more about the return structure (pages plus snippets) but does enough for an agent to call it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all six parameters. The description adds no parameter-specific meaning beyond implying that snippets are returned. Baseline 3 is appropriate when the schema does the heavy lifting.

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 description states a specific verb and resource: 'Locate the most relevant pages and snippets in a PDF.' It distinguishes itself from siblings by sequencing ('Call after doc_outline before reading pages'), making clear it is a search/retrieval step rather than a full read.

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

Usage Guidelines4/5

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

It gives explicit when-to-use guidance: 'Call after doc_outline before reading pages.' This tells the agent where it fits in the workflow. It does not explicitly name when not to use it or mention doc_read as an alternative, but the context is clear.

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

Deploy Server

Other Tools