Skip to main content
Glama
Document Reader MCP Server

Document Reader MCP Server

by abdo544445

search_document

Search an entire document for a query and return matched pages or chunks with context snippets, so you can locate relevant content without reading every page.

Instructions

Search for a query string across an entire document. Returns the matched pages/chunks with surrounding context snippets. Much more efficient than reading the whole document page by page.

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

Input Schema

NameRequiredDescriptionDefault
queryYesThe text to search for (case-insensitive)
filePathYesAbsolute path to the file
passwordNoOptional password for encrypted/protected PDF files

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the return shape ('matched pages/chunks with surrounding context snippets') and a performance trait relative to full reads, but says nothing about result limits, truncation, whether matches are ranked or ordered, or that it is a read-only operation.

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?

Three short sentences, front-loaded with what the tool does, followed by the return shape and the efficiency rationale. No filler, and each sentence contributes distinct information an agent would act on.

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 simple three-parameter search tool with no output schema, the description covers action, scope, return contents, and the efficiency tradeoff. The gap is minor: nothing about match limits or result ordering, which an agent planning around large documents might want.

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 coverage is 100%, with case-insensitivity, path format, and the password parameter already documented in the schema. The description only restates 'query string' and adds the scope note 'across an entire document', which is modest but does imply no range restriction; baseline 3 applies 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.

Purpose4/5

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

The first sentence names a specific verb and resource ('Search for a query string across an entire document'), and the third sentence distinguishes it behaviorally from page-by-page reading (read_document_page / read_full_document). It stops short of naming a sibling, so an agent must map 'reading the whole document page by page' to the actual tool name itself.

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?

Clear positive guidance: use this instead of reading the whole document when you want to locate a string, which is exactly the decision an agent faces against read_full_document. No explicit exclusions (e.g., when a structural or OCR-based lookup is preferable to search), so it falls short of the 5 bar.

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