Skip to main content
Glama
Xvvln

io.github.Xvvln/pdf-reader-mcp

by Xvvln

pdf-reader-mcp

一个用于读取和分析 PDF 文件的 MCP 服务器。它可以为支持 MCP(Model Context Protocol)的客户端提供 PDF 文本、页面图片、表格、链接、批注、目录、元数据和基础文本统计。

A PDF-focused MCP server for extracting text, rendered pages, tables, links, annotations, outlines, metadata, and text statistics from PDF files.

Package name

  • GitHub repository: pdf-reader-mcp

  • MCP Registry name: io.github.Xvvln/pdf-reader-mcp

  • PyPI package: pdf-insight-mcp

  • CLI commands: pdf-reader-mcp and pdf-insight-mcp

pdf-reader-mcp is the project name. The PyPI package is published as pdf-insight-mcp because the pdf-reader-mcp package name is not available on PyPI.

Related MCP server: MCP PDF Server

Features

Tool

What it does

get_pdf_info

Read document metadata, page count, file size, and encryption status.

read_pdf_as_text

Extract text from selected pages with page and character limits.

read_pdf_as_images

Render selected pages as base64-encoded images.

get_pdf_outline

Read bookmarks and outline entries.

search_pdf_text

Search text and return per-match page context.

extract_pdf_tables

Extract structured tables when PyMuPDF can detect them.

extract_pdf_images

Extract embedded PDF images.

get_pdf_page_info

Inspect one page's size, text, images, links, and rotation.

extract_pdf_links

Extract external URLs and internal page jumps.

get_pdf_annotations

Read comments, highlights, and annotation metadata.

get_pdf_text_stats

Compute text, line, paragraph, and scan-likelihood stats.

compare_pdf_pages

Compare text similarity between two pages.

Quick start

Install uv if you do not already have it:

curl -LsSf https://astral.sh/uv/install.sh | sh

Run the server directly from PyPI:

uvx pdf-insight-mcp

Or install it first:

python -m pip install pdf-insight-mcp
pdf-reader-mcp

MCP client configuration

Use the published PyPI package:

{
  "mcpServers": {
    "pdf-reader": {
      "command": "uvx",
      "args": ["pdf-insight-mcp"]
    }
  }
}

Use a local checkout for development:

{
  "mcpServers": {
    "pdf-reader": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/pdf-reader-mcp",
        "run",
        "pdf-reader-mcp"
      ]
    }
  }
}

Replace /absolute/path/to/pdf-reader-mcp with the absolute path to this repository on your machine.

Common usage

Ask your MCP client to call tools with an absolute PDF path. Example requests:

Read /Users/me/Documents/report.pdf as text.
Search /Users/me/Documents/report.pdf for "baseline characteristics".
Render pages 1-3 of /Users/me/Documents/report.pdf as images.
Extract links and annotations from /Users/me/Documents/review.pdf.

For large PDFs, prefer small page ranges first. For scanned or layout-sensitive PDFs, use read_pdf_as_images with a small pages range and moderate dpi.

Limits and behavior

  • read_pdf_as_text defaults to at most 50 pages and 200000 returned characters.

  • read_pdf_as_images rejects requests above 20 pages.

  • read_pdf_as_images defaults to an overall image payload cap of about 20 MB.

  • extract_pdf_images returns at most 20 embedded images but reports the actual detected total.

  • Encrypted PDFs are rejected unless they are already accessible without a password.

  • Scanned PDFs may have little or no extractable text. Use image rendering or OCR outside this server when needed.

Development

Install dependencies:

uv sync --extra dev

Run tests:

uv run pytest -q

Build the package:

uv build
uvx twine check dist/*

Run the local server:

uv run pdf-reader-mcp

Release

Releases are published through GitHub Actions.

Before the first release, configure PyPI Trusted Publishing with:

PyPI project name: pdf-insight-mcp
Owner: Xvvln
Repository name: pdf-reader-mcp
Workflow filename: publish.yml
Environment name: leave empty

Then release by bumping versions in pyproject.toml and server.json, committing the change, and pushing a version tag:

git tag vX.Y.Z
git push origin main --tags

The Publish workflow runs tests, builds the Python package, publishes to PyPI, authenticates to the MCP Registry with GitHub OIDC, and publishes server.json.

Tech stack

  • Python 3.10+

  • MCP Python SDK

  • PyMuPDF

  • uv

  • pytest

License

MIT

Available Tools

12 tools
compare_pdf_pagesA

比较PDF中两个页面的文本差异。

Args: file_path: PDF文件的完整路径 page1: 第一个页码(从1开始) page2: 第二个页码(从1开始)

Returns: 包含以下信息的字典: - page1_chars: 第一页字符数 - page2_chars: 第二页字符数 - common_lines: 相同的行数 - page1_unique_lines: 仅在第一页出现的行数 - page2_unique_lines: 仅在第二页出现的行数 - similarity: 相似度(0-1)

ParametersJSON Schema
NameRequiredDescriptionDefault
page1Yes
page2Yes
file_pathYes

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are present, so the description carries full burden. It explains the return dictionary structure (e.g., similarity score, unique lines) but does not disclose limitations like handling of scanned PDFs or performance characteristics.

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

Conciseness3/5

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

The description is somewhat verbose with a full Args/Returns block. While well-structured, it could be more concise without losing essential 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 tool's complexity (text comparison), the description covers input parameters and return fields, including similarity. However, it lacks details on edge cases (e.g., missing pages) and has no output schema.

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?

Schema description coverage is 0%, but the description adds meaning by explaining each parameter (e.g., file_path as 'full path', page numbers as 1-based). This compensates for the schema gap.

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's purpose: comparing text differences between two PDF pages. It uses a specific verb ('compare') and resource ('PDF pages'), differentiating it from sibling tools like get_pdf_page_info or read_pdf_as_text.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description only states the general purpose, lacking context or exclusions for use cases.

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

extract_pdf_imagesB

提取PDF中嵌入的图片。

Args: file_path: PDF文件的完整路径 pages: 要提取的页码范围(可选,默认全部页面) min_width: 最小图片宽度,过滤小图片,默认100像素 min_height: 最小图片高度,过滤小图片,默认100像素

Returns: 包含以下信息的字典: - total_images: 图片总数 - images: 图片列表,每个包含: - page: 页码 - image_index: 该页中的图片索引 - width: 宽度 - height: 高度 - format: 图片格式 - image_base64: base64编码的图片数据

ParametersJSON Schema
NameRequiredDescriptionDefault
pagesNo
file_pathYes
min_widthNo
min_heightNo

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It explains input/output but omits important traits such as how it handles corrupted PDFs, permissions required, or whether images from headers/footers are included. Edge cases are not addressed.

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?

The description is well-structured with clear 'Args' and 'Returns' sections, and each sentence serves a purpose. It is concise enough, though the Returns section could be slightly more compact without losing clarity.

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

Completeness3/5

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

The description covers input parameters and return values adequately for a tool with 4 params and no output schema. However, it lacks context about error handling, performance implications, or how it compares with siblings. Given the complexity of PDFs, more details on unsupported cases would improve completeness.

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?

With 0% schema description coverage, the description adds significant meaning by explaining each parameter's purpose, defaults, and filtering behavior. However, the format for the 'pages' parameter (e.g., '1-5,7') is not specified, leaving some ambiguity. Overall, it partially compensates for the missing 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 extracts embedded images from PDF files, using the verb 'extract' and specifying the resource 'PDF images'. It distinguishes well from sibling tools like 'read_pdf_as_images' (which converts pages to images) and 'extract_pdf_tables' (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 Guidelines2/5

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

The description does not provide explicit guidance on when to use this tool versus alternatives. For instance, it does not mention that for extracting images from the entire page as rendered, 'read_pdf_as_images' should be used instead, nor does it specify prerequisites or limitations.

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

extract_pdf_tablesA

提取PDF中的表格数据。

注意:表格提取依赖PDF的结构,对于复杂或扫描版PDF可能效果不佳。

Args: file_path: PDF文件的完整路径 pages: 要提取的页码范围(可选,默认全部页面)

Returns: 包含以下信息的字典: - total_tables: 表格总数 - tables: 表格列表,每个包含: - page: 页码 - table_index: 该页中的表格索引 - rows: 行数 - cols: 列数 - data: 表格数据(二维数组)

ParametersJSON Schema
NameRequiredDescriptionDefault
pagesNo
file_pathYes

TDQS

A4.2/5.0
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 mentions dependency on PDF structure and a caveat about complex/scanned PDFs, but does not explicitly state that the tool is read-only or discuss permissions, performance, or side effects.

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 with a clear header, a useful caveat note, and structured Args/Returns sections. Every sentence adds value without unnecessary verbosity.

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?

With 2 parameters and no output schema, the description adequately explains the return structure in detail. However, it does not cover error handling or the exact format for the pages parameter, leaving some gaps.

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?

Schema description coverage is 0%, so the description must compensate. It explains both parameters: file_path as the full path and pages as an optional range (default all pages). However, the format of the page range is not specified (e.g., '1-3,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 description clearly states the tool's purpose: '提取PDF中的表格数据' (extract tabular data from PDF). It uses a specific verb and resource, and is well distinguished from siblings that extract text, images, links, etc.

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?

The description includes a note about limitations: '表格提取依赖PDF的结构,对于复杂或扫描版PDF可能效果不佳' (table extraction depends on PDF structure; may not work well for complex or scanned PDFs). This provides when-not-to-use guidance, but it does not explicitly mention alternative tools from the sibling list.

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

get_pdf_annotationsA

获取PDF中的注释(批注、高亮、下划线等)。

Args: file_path: PDF文件的完整路径 pages: 要提取的页码范围(可选,默认全部页面)

Returns: 包含以下信息的字典: - total_annotations: 注释总数 - annotations: 注释列表,每个包含: - page: 页码 - type: 注释类型 - content: 注释内容 - author: 作者

ParametersJSON Schema
NameRequiredDescriptionDefault
pagesNo
file_pathYes

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are provided, so the description carries full burden. It describes the return format and parameters but does not disclose potential side effects, authorization needs, or rate limits. It is adequate but not rich.

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, using bullet points for arguments and returns. Every sentence adds value without redundancy.

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?

Given no output schema, the description thoroughly explains the return dictionary structure. Parameter descriptions are sufficient, and the tool fits clearly among PDF siblings. It is complete for the tool's complexity.

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?

Schema coverage is 0%, so the description must compensate. It explains file_path as full path and pages as optional range with default all pages. This adds meaning beyond the bare schema, meeting the baseline for low coverage.

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 it annotates PDF files (getting 批注、高亮、下划线等). It uses a specific verb and resource, and distinguishes from sibling tools like get_pdf_info or read_pdf_as_text by focusing solely on annotations.

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 usage for extracting annotations but does not explicitly state when to use it versus alternatives, nor does it mention prerequisites or exclusions. It lacks guidance on context.

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

get_pdf_infoB

获取PDF文件的基本信息。

Args: file_path: PDF文件的完整路径

Returns: 包含以下信息的字典: - page_count: 页数 - title: 标题 - author: 作者 - subject: 主题 - creator: 创建程序 - producer: 生成程序 - creation_date: 创建日期 - modification_date: 修改日期 - file_size: 文件大小(字节) - file_size_mb: 文件大小(MB) - is_encrypted: 是否加密

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYes

TDQS

B3.3/5.0
Behavior3/5

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

No annotations provided, so the description must cover behavior. It lists return fields but does not state that the operation is read-only, nor does it mention permissions, file existence requirements, or error handling. The implied nature (local file read) provides some transparency.

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?

The description is well-structured with Args and Returns sections, listing all return fields. It is concise with no unnecessary content, though it could be slightly shorter.

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

Completeness3/5

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

Given no output schema, the description adequately details the return dictionary. However, it omits edge cases (e.g., missing file, encrypted handling) and does not position itself among the 12 sibling tools, which could confuse selection.

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 single parameter file_path is described as 'PDF文件的完整路径' (full path of PDF file), adding meaning beyond the schema's title 'File Path'. This compensates for 0% schema coverage.

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 description clearly states it retrieves basic PDF metadata (page_count, title, author, etc.), distinguishing it from siblings like read_pdf_as_text (text content) or get_pdf_page_info (page-specific data). However, it doesn't explicitly contrast with siblings.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives such as get_pdf_page_info or extract_pdf_tables. The description lacks context about prerequisites or scenario appropriateness.

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

get_pdf_outlineA

获取PDF的书签/目录结构(大纲)。

Args: file_path: PDF文件的完整路径

Returns: 包含以下信息的字典: - has_outline: 是否有目录 - outline_count: 目录条目数量 - outline: 目录列表,每个元素包含: - level: 层级(1开始) - title: 标题 - page: 页码

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYes

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries full burden. It details return values (has_outline, outline_count, outline with level, title, page) but does not mention error handling, file existence prerequisites, 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.

Conciseness4/5

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

The description is concise with a clear purpose line and structured Args/Returns sections. However, it could be more succinct by removing redundant Chinese/English phrasing.

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 tool's simplicity, the description adequately explains the return format. However, it lacks information on error conditions (e.g., invalid file) and performance considerations, which would be expected for a file processing tool.

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?

Schema coverage is 0%, but the description adds the parameter meaning: 'full path of PDF file'. This compensates for the lack of schema descriptions and adds context beyond the parameter name.

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 verb 'get' and the resource 'PDF bookmark/outline structure', making it distinct from sibling tools like get_pdf_info or read_pdf_as_text.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, such as comparing with get_pdf_info for other PDF properties. The description only explains what the tool does, not the context of use.

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

get_pdf_page_infoA

获取PDF指定页面的详细信息。

Args: file_path: PDF文件的完整路径 page: 页码(从1开始)

Returns: 包含以下信息的字典: - page_number: 页码 - width: 页面宽度(点) - height: 页面高度(点) - rotation: 旋转角度 - has_text: 是否包含文本 - text_length: 文本长度 - image_count: 图片数量 - link_count: 链接数量

ParametersJSON Schema
NameRequiredDescriptionDefault
pageYes
file_pathYes

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the tool returns a dictionary with specific fields but does not mention if it is read-only, requires file permissions, or handles errors. Basic disclosure is present, but more detail on behavioral traits is missing.

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?

The description is structured with Args and Returns sections, making it easy to parse. It is not overly concise but is well-organized and front-loaded with the purpose. Could be slightly shortened without losing clarity.

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 tool's simplicity (2 required params, no output schema), the description adequately explains parameters and return values. However, it lacks information on error handling or edge cases (e.g., invalid path or page number).

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 must compensate. It fully explains both parameters: 'file_path: PDF文件的完整路径' and 'page: 页码(从1开始)', adding clear meaning beyond just names and types.

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 '获取PDF指定页面的详细信息' (get details of a specified PDF page), specifying the verb 'get' and the resource 'PDF page info'. It distinguishes this tool from siblings like 'get_pdf_info' (which likely covers the whole document) by focusing on a single page's detailed properties.

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

Usage Guidelines2/5

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

The description does not explicitly state when to use this tool versus alternatives. It implies usage for getting detailed page info but lacks guidance on prerequisites, exclusions, or conditions where another sibling would be more appropriate.

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

get_pdf_text_statsA

获取PDF文本的统计信息(字数、字符数、段落数等)。

Args: file_path: PDF文件的完整路径 pages: 要统计的页码范围(可选,默认全部页面)

Returns: 包含以下信息的字典: - total_pages: 总页数 - analyzed_pages: 分析的页数 - total_characters: 总字符数 - total_characters_no_space: 不含空格的字符数 - total_words: 总词数(按空格分割) - total_lines: 总行数 - total_paragraphs: 总段落数 - avg_chars_per_page: 平均每页字符数 - avg_words_per_page: 平均每页词数 - is_likely_scanned: 是否可能是扫描版PDF

ParametersJSON Schema
NameRequiredDescriptionDefault
pagesNo
file_pathYes

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description relies entirely on its own text. It thoroughly details return values (including 'is_likely_scanned') and implies safe, read-only behavior. However, it omits potential performance impacts or file access requirements.

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?

The description is front-loaded with the main purpose and uses a clear Args/Returns structure. It is concise, though the Returns section could be slightly trimmed; overall, every sentence adds value.

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?

For a relatively simple tool with two parameters and no output schema, the description covers all necessary information: parameter explanations and a detailed list of return fields. It is complete for effective agent invocation.

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?

Despite 0% schema coverage, the description fully compensates by defining each parameter: 'file_path' as the full path and 'pages' as an optional page range (default all pages). This adds meaning beyond the schema's minimal titles.

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's function: retrieving PDF text statistics (word count, character count, etc.). It distinguishes itself from siblings like 'read_pdf_as_text' (extraction) and 'get_pdf_info' (metadata) by focusing solely on analytical metrics.

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

Usage Guidelines2/5

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

The description does not provide explicit guidance on when to use this tool versus alternatives. It only states what it does, leaving the agent to infer appropriate usage without mentioning exclusions or contexts.

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

read_pdf_as_imagesA

将PDF页面转换为图片(base64编码)返回。适合需要保留原始排版、图表、公式的场景。

Args: file_path: PDF文件的完整路径 pages: 要读取的页码,支持多种格式: - 不传或"all": 所有页面 - "1": 单页 - "1-5": 页码范围 - "1-": 从第1页到末尾 - "-5": 从开头到第5页 - "1,3,5": 指定多页 - "1-3,5,7-9": 混合格式 dpi: 图片分辨率,默认150。72=低质量小文件,150=平衡,300=高清大文件 image_format: 图片格式,"jpeg"(默认,文件小)或"png"(无损,文件大) quality: JPEG压缩质量(1-100),默认85。仅对jpeg格式有效,值越低文件越小但质量越差 max_total_bytes_mb: 单次调用允许返回的最大图片负载(MB),默认20

Returns: 图片列表,每个元素包含: - page_number: 页码(从1开始) - image_base64: 图片的base64编码 - width: 图片宽度(像素) - height: 图片高度(像素) - format: 图片格式 - truncated: 是否因大小限制被截断 - warning: 截断或限制提示(可选)

ParametersJSON Schema
NameRequiredDescriptionDefault
dpiNo
pagesNo
qualityNo
file_pathYes
image_formatNojpeg
max_total_bytes_mbNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavior: images are base64 encoded, return structure includes page number, dimensions, format, and truncation info. It explains the max_total_bytes_mb limit and that quality only applies to jpeg, giving agents full awareness of output characteristics and constraints.

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 well-structured: a concise summary sentence followed by Args and Returns sections. Each sentence adds essential information without redundancy. Despite length, it is efficiently organized and front-loaded with the core purpose, making it easy for an agent to scan.

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?

Given the complexity of 6 parameters and no annotations, the description thoroughly covers all inputs (including edge cases like mixed page formats) and outputs (including truncated and warning fields). The output schema exists, but the description still explains return elements, making the tool fully understandable.

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?

The input schema has 0% description coverage, so the description provides all parameter semantics. It explains file_path requirement, pages format (with examples), dpi trade-offs, image_format defaults, quality range and exclusive jpeg applicability, and max_total_bytes_mb. This adds significant value beyond the raw schema.

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 converts PDF pages to base64 images, specifies the verb and resource, and explicitly mentions suitable scenarios (retaining layout, charts, formulas), distinguishing it from sibling tools like read_pdf_as_text.

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?

The description provides context on when to use the tool (scenarios needing original layout) and includes detailed parameter usage guidance. It does not explicitly exclude cases or name alternatives, but the purpose and sibling list imply when to choose this over text or other extraction tools.

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

read_pdf_as_textA

提取PDF的文本内容。适合纯文本PDF,速度快,消耗token少。

注意:对于扫描版PDF(图片PDF),此方法可能无法提取文本,建议使用read_pdf_as_images。

Args: file_path: PDF文件的完整路径 pages: 要读取的页码,支持多种格式: - 不传或"all": 所有页面 - "1": 单页 - "1-5": 页码范围 - "1-": 从第1页到末尾 - "-5": 从开头到第5页 - "1,3,5": 指定多页 - "1-3,5,7-9": 混合格式 max_pages: 单次调用最多返回的页数,默认50 max_chars: 单次调用最多返回的总字符数,默认200000

Returns: 包含以下信息的字典: - total_pages: 总页数 - extracted_pages: 提取的页码列表 - pages: 每页内容列表,包含page_number和text - full_text: 所有页面的合并文本 - warning: 警告信息(如检测到可能是扫描版PDF或结果被截断)

ParametersJSON Schema
NameRequiredDescriptionDefault
pagesNo
file_pathYes
max_charsNo
max_pagesNo

TDQS

A4.9/5.0
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses speed, low token consumption, limitation to text PDFs, and includes warnings for scanned PDF detection and truncation. The return structure is also described.

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?

The description is well-structured with separate sections for purpose, args, and returns. It is front-loaded with the main purpose and limitations. However, it is somewhat lengthy; slight trimming could improve conciseness without losing value.

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?

Given the tool has 4 parameters and no output schema, the description fully covers the return dictionary, potential warnings, and parameter behavior. It addresses edge cases like scanned PDFs and result truncation, making it complete for the tool's complexity.

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%, but the description compensates with detailed explanations of pages, max_pages, and max_chars. The pages parameter is especially well-documented with multiple format examples. The file_path parameter is minimally described, but the schema title is clear.

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 extracts text content from PDFs, specifying it is suitable for text PDFs and distinguishing it from read_pdf_as_images for scanned PDFs. The verb 'extract' and resource 'PDF text' are specific, and the sibling differentiation is explicit.

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?

The description provides explicit guidance: suitable for text PDFs, not for scanned PDFs, and recommends the alternative tool read_pdf_as_images for scanned PDFs. It also explains the pages parameter in detail, helping the agent understand how to use it correctly.

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

search_pdf_textA

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

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

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

ParametersJSON Schema
NameRequiredDescriptionDefault
pagesNo
queryYes
file_pathYes
max_resultsNo

TDQS

A4/5.0
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.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 12 tool updatesv0.2.1
    • First observedcompare_pdf_pages
    • First observedextract_pdf_images
    • First observedextract_pdf_links
    • First observedextract_pdf_tables
    • First observedget_pdf_annotations
    • First observedget_pdf_info
    • First observedget_pdf_outline
    • First observedget_pdf_page_info
    • First observedget_pdf_text_stats
    • First observedread_pdf_as_images
    • First observedread_pdf_as_text
    • First observedsearch_pdf_text

TDQS

A4/5.0
Disambiguation5/5

Each tool has a distinct purpose: metadata, page info, text extraction, image conversion, outline, search, extraction of tables/images/links/annotations, statistics, and comparison. No two tools overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in English (e.g., get_pdf_info, read_pdf_as_images, extract_pdf_tables), using snake_case throughout.

Tool Count5/5

12 tools cover the essential operations for a PDF reader without being excessive. The scope is well-balanced: reading, extraction, search, and analysis.

Completeness5/5

The tool set covers almost all common read-only PDF operations: metadata, page info, text, images, outline, search, tables, links, annotations, statistics, and page comparison. Missing creation or editing, but they are out of scope for a reader.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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