Skip to main content
Glama
Xvvln

io.github.Xvvln/pdf-reader-mcp

by Xvvln

search_pdf_text

Search for text in a PDF file and retrieve matching locations and surrounding context. Specify a query and optional page range to limit results.

Instructions

在PDF中搜索文本,返回匹配位置和上下文。

Args: file_path: PDF文件的完整路径 query: 搜索关键词 pages: 搜索的页码范围(可选,默认全部页面) max_results: 最大返回结果数,默认50

Returns: 包含以下信息的字典: - query: 搜索关键词 - total_matches: 匹配总数 - pages_with_matches: 有匹配的页码列表 - results: 匹配结果列表,每个包含: - page: 页码 - context: 匹配的上下文文本

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesNo
queryYes
file_pathYes
max_resultsNo
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes the search operation and return values, but does not explicitly state that the tool is read-only (does not modify the PDF), nor does it mention error handling, performance, or limitations. The default for max_results is disclosed, but behavioral traits beyond that are vague.

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?

The description is concise and well-structured with a brief summary followed by clearly labeled Args and Returns sections. Every sentence adds value, no redundant information.

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?

Given the presence of many sibling tools (e.g., read_pdf_as_text, extract_pdf_tables), this description sufficiently explains the tool's purpose, inputs, and output format. It lacks information on edge cases (e.g., no matches found) but overall provides enough context for an AI agent to use it correctly.

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

Parameters4/5

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

The input schema has 0% description coverage, but the tool description provides clear explanations for each parameter (file_path, query, pages, max_results) in the Args section, including optionality and defaults. It also describes the return structure in detail, compensating well for the lack of schema descriptions.

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 clearly states the tool searches for text in a PDF and returns match positions and context. It uses a specific verb ('search') and resource ('PDF text'), and distinguishes itself from siblings like read_pdf_as_text (which extracts all text) and extract_pdf_tables (which extracts tables).

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

Usage Guidelines3/5

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

The description implies that this tool is for searching text within a PDF, but it does not explicitly state when to use it versus alternatives such as read_pdf_as_text for full text extraction or get_pdf_text_stats for textual statistics. No exclusions or conditional guidance is provided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Xvvln/pdf-reader-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server