Skip to main content
Glama
mematcha

pdf-context

by mematcha

PDF Context Server

PDF Context (pdf-context on PyPI, import pdf_context) is a local-first library and MCP server that transforms PDF documents into structured, retrievable context for AI applications.

Drop PDFs into a watch folder, and the server ingests them automatically — extracting structure, classifying document type, chunking with awareness of chapters/sections, embedding locally, and exposing retrieval tools that AI clients use to teach, answer questions, or navigate documents sequentially.

Drop in PDFs. Build context once. Query from anywhere.


Install

From PyPI (when published):

pip install pdf-context

From source (development):

git clone https://github.com/yourusername/pdf-context-server.git
cd pdf-context-server
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env

Console entry points:

  • pdf-context — developer CLI (ingest, search, smoke tests)

  • pdf-context-mcp — MCP stdio server for AI clients


Related MCP server: doc-index

Programmatic API

from pdf_context import PdfContext, PdfContextConfig

config = PdfContextConfig(
    pdf_data_dir="/path/to/pdfs",
    storage_dir="/path/to/storage",
)
ctx = PdfContext(config, watch=False)
ctx.ingest("my-book.pdf")
results = ctx.search("virtual memory", document="my-book.pdf", top_k=5)
print(results["chunks"])

Each PdfContext instance is isolated: separate (pdf_dir, storage_dir) pairs get separate SQLite + Chroma indexes.


Features (v1)

  • PDF ingestion with folder watch and background job queue

  • Structure extraction from PDF outlines, heading heuristics, or page-level fallback

  • Auto document classification: textbook, technical_reference, paper, notes

  • Per-type retrieval profiles (chunk size, sequential vs semantic-first)

  • Local embeddings (sentence-transformers default, Ollama optional)

  • ChromaDB vector storage + SQLite metadata

  • Semantic search with structure filters (chapter, section, page range)

  • Sequential navigation for chapter-by-chapter learning

  • MCP stdio server for any compatible AI client

  • Production-grade local reliability: dedup, retries, checkpoints, resume


Architecture

PDF Documents (data/pdfs/)
      │
      ▼
 Folder Watcher ──► Job Queue (SQLite)
      │
      ▼
 Structure Extract + Classify + Parse + Chunk + Embed
      │
      ├──► ChromaDB (vectors + metadata)
      └──► SQLite (documents, structure, chunks, jobs)
      │
      ▼
 MCP Server (stdio)
      ├── NavigationalEngine (sequential / section content)
      └── SemanticEngine (scoped semantic search)
      │
      ▼
 AI Client (Cursor, Claude Desktop, etc.)

Project Structure

pdf-context-server/
├── pdf_context/                # installable package
│   ├── client.py               # PdfContext public API
│   ├── config.py               # PdfContextConfig
│   ├── context.py              # AppContext runtime
│   ├── cli.py                  # pdf-context CLI
│   ├── mcp/                    # MCP factory + stdio entry
│   ├── classification/
│   ├── structure/
│   ├── parsers/
│   ├── chunking.py
│   ├── embeddings.py
│   ├── vector_store.py
│   ├── db/
│   ├── ingest/
│   ├── retrieval/
│   └── skills/                 # bundled agent skills (CLI install)
├── app/                        # deprecated shim (python -m app.main)
├── .cursor/
│   ├── mcp.json                # project MCP config (example)
│   └── skills/pdf-context/
├── data/pdfs/
├── storage/
├── tests/
├── pyproject.toml
├── requirements.txt            # dev convenience (see pyproject.toml)
├── .env.example
└── README.md

Installation (legacy dev clone)

See Install above. requirements.txt mirrors runtime deps; prefer pip install -e ".[dev]".


Quick test (no MCP required)

Drop a PDF in data/pdfs/, then run one command:

pdf-context smoke

That ingests all PDFs, runs a sample search, and prints PASS or FAIL with details.

Other useful commands:

pdf-context status
pdf-context list
pdf-context ingest
pdf-context ingest "my-book.pdf"
pdf-context search "virtual memory" -d "my-book.pdf"
pdf-context --pdf-dir /path/pdfs --storage-dir /path/storage status
pdf-context skill list
pdf-context skill install
pytest

Or with Make: make smoke, make status, make test.

MCP is for daily use in Cursor. The CLI is for verifying everything works without configuring or reloading MCP.


Adding Documents

Place PDFs in your configured PDF folder (default data/pdfs/):

data/pdfs/
├── operating-systems.pdf
├── api-reference.pdf
└── lecture-notes.pdf

Keep PDF and storage folders separate. pdf_data_dir and storage_dir must not be the same path, and neither may live inside the other. Mixing them causes the folder watcher to pick up Chroma/SQLite files, or ingest metadata into your PDF tree. Use sibling directories (defaults data/pdfs/ + storage/ are fine).

The folder watcher auto-enqueues new or changed PDFs for ingestion.

Optional type override sidecar:

data/pdfs/operating-systems.pdf.meta.json
{ "doc_type": "textbook" }

Valid types: textbook, technical_reference, paper, notes


MCP Setup

Enable pdf-context only in projects where PDFs are your source of truth. Avoid enabling it globally in Cursor user settings if most chats are code or general work—when the server is disconnected, the model cannot call PDF tools at all.

Add to project .cursor/mcp.json (Cursor) or your client's MCP config:

{
  "mcpServers": {
    "pdf-context": {
      "command": "pdf-context-mcp",
      "args": [
        "--pdf-dir", "/absolute/path/to/pdfs",
        "--storage-dir", "/absolute/path/to/storage"
      ]
    }
  }
}

No repo clone required after pip install pdf-context. For local dev, point command at .venv/bin/pdf-context-mcp.

Legacy (deprecated): "command": "python", "args": ["-m", "app.main"]

Use a descriptive server name (pdf-context, pdf-ml-book, pdf-papers) so rules and skills can refer to the right corpus.

Restart or reload MCP after changing config.

Multiple corpora (research vs papers)

Run one MCP process per (pdf folder, storage) pair. Example:

{
  "mcpServers": {
    "pdf-textbooks": {
      "command": "pdf-context-mcp",
      "args": [
        "--pdf-dir", "/Users/me/books",
        "--storage-dir", "/Users/me/.pdf-context/books",
        "--instance-id", "textbooks"
      ]
    },
    "pdf-papers": {
      "command": "pdf-context-mcp",
      "args": [
        "--pdf-dir", "/Users/me/papers",
        "--storage-dir", "/Users/me/.pdf-context/papers",
        "--instance-id", "papers"
      ]
    }
  }
}

Or via environment (PDF_CONTEXT_PDF_DATA_DIR, PDF_CONTEXT_STORAGE_DIR; legacy PDF_DATA_DIR / STORAGE_DIR still work):

"env": {
  "PDF_CONTEXT_PDF_DATA_DIR": "/Users/me/books",
  "PDF_CONTEXT_STORAGE_DIR": "/Users/me/.pdf-context/books"
}

When the AI client should call MCP tools

The model chooses tools from your message, tool descriptions, and project skills—it is not automatic. This project steers that behavior in three layers:

  1. Tool docstrings in pdf_context/mcp/server.py — each tool states use when / do not use when.

  2. Project skill.cursor/skills/pdf-context/SKILL.md tells Cursor when to use pdf-context vs codebase tools.

  3. Project-scoped MCP — enable the server only where PDFs matter.

User intent

Expected tools

Fix code / git / tests

None (pdf-context idle)

"What does the book say about X?"

search_pdf_context (+ maybe list_documents)

Chapter walkthrough with cites

list_chapters, get_section_content, get_next_chunks

"Is my PDF indexed?"

get_ingest_status, list_documents

Casual chat

None

Phrases that help: "From the indexed PDFs…", "Search [filename] for…", "Don't guess—use pdf-context."

Phrases that skip PDF tools: "In general (no PDF)", "Fix this Python file."

After pulling this repo, reload MCP so clients pick up new tool descriptions.

Install agent skill for any AI client

Bundled skills live in pdf_context/skills/. Install into Cursor, Claude Code, VS Code Copilot, Codex/AGENTS.md, Windsurf, Gemini, or a custom path:

pdf-context skill install
pdf-context skill list
pdf-context skill install -s pdf-context -c claude-code -p .

--client

Writes to

cursor-project

.cursor/skills/pdf-context/SKILL.md

cursor-global

~/.cursor/skills/pdf-context/SKILL.md

claude-code

CLAUDE.md

vscode-copilot

.github/copilot-instructions.md

codex-agents

AGENTS.md

windsurf

.windsurfrules

gemini

GEMINI.md

custom

path from --output

Markdown targets include marked blocks (<!-- pdf-context-skill:start/end -->) so re-running install can update the section without wiping your file.


MCP Tools

Tool

Purpose

list_documents

Corpus check — what's indexed; call if unsure scope

get_ingest_status

Queue health; new PDFs; empty search debugging

get_document_profile

Doc type, retrieval profile, per-document guidance

list_structure

Full TOC tree

list_chapters

Flat chapter list (textbooks)

get_section_content

Ordered chunks for a chapter/section

get_next_chunks

Sequential read-ahead from cursor

search_pdf_context

Semantic search with optional structure filters

set_document_type

Override auto-classification (when user asks)

reingest_document

Force re-index (when user asks)

Each tool's MCP description includes when to call it and when to skip it.


Document Types

Type

Treatment

textbook

Sequential chapter navigation; larger chunks; chapter-scoped search

technical_reference

Semantic-first; section-scoped search; no forced sequential reading

paper

Section-scoped semantic search (abstract, methods, etc.)

notes

Weak structure; semantic-only; page-level fallback navigation

Classification is automatic at ingest. Override via .meta.json or set_document_type.


Chapter-by-Chapter Learning Workflow

The AI client holds progress via the cursor returned by navigational tools.

1. get_document_profile("operating-systems.pdf")
2. list_chapters("operating-systems.pdf")
3. get_section_content("operating-systems.pdf", node_id=<chapter_id>, limit=5)
4. [Client teaches / summarizes from returned chunks]
5. search_pdf_context("page faults", document="operating-systems.pdf", chapter_id=<id>)
6. get_next_chunks("operating-systems.pdf", cursor=<last_cursor>, limit=5)

For unstructured notes, use list_structure and semantic search without sequential navigation.


Configuration

See .env.example. Key settings:

Variable

Default

Description

PDF_CONTEXT_PDF_DATA_DIR

data/pdfs

PDF watch folder (must not overlap storage)

PDF_CONTEXT_STORAGE_DIR

storage

SQLite + Chroma (must not overlap PDF folder)

PDF_CONTEXT_EMBEDDING_PROVIDER

sentence_transformers

or ollama

PDF_CONTEXT_EMBEDDING_MODEL

all-MiniLM-L6-v2

Local embedding model

PDF_CONTEXT_WATCH_ENABLED

true

Auto-ingest on folder changes

PDF_CONTEXT_CHECKPOINT_PAGE_INTERVAL

50

Resume checkpoint during large ingests

Legacy PDF_DATA_DIR / STORAGE_DIR (no prefix) are accepted for one release.

Path layout rule: After resolving to absolute paths, pdf_data_dir and storage_dir must differ and must not be nested (parent/child). Configuration is validated at startup when directories are created; invalid layouts raise a clear error.

First ingest of a large library (20+ textbooks, ~20k pages) on CPU may take hours. Checkpoints make ingestion resumable if interrupted.


Technology Stack

  • Python 3.11+

  • PyMuPDF — PDF parsing and outline extraction

  • sentence-transformers — local embeddings

  • ChromaDB — vector storage

  • SQLite — metadata, structure, job queue

  • MCP — AI client integration

  • watchdog — folder watching


Development

pip install -e ".[dev]"
pytest
pdf-context --help
pdf-context-mcp --help

Vision

PDF Context Server converts static PDFs into structured, searchable knowledge that AI applications consume on demand — without re-uploading documents every session.

Retrieval, not synthesis: the server returns ranked chunks and structure metadata; your AI client generates answers, lessons, and summaries.

Available Tools

10 tools
get_document_profile_toolA

Get document type, retrieval profile, and how to query a specific PDF.

Use when starting work on a named document, when choosing between semantic search vs sequential reading, or when the user asks how a document is classified (textbook, paper, etc.).

Do not use for documents not in this server's index or for general ML/PDF advice unrelated to a specific ingested file.

ParametersJSON Schema
NameRequiredDescriptionDefault
documentYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description bears full responsibility for behavioral disclosure. It indicates the tool retrieves document type, retrieval profile, and query strategy, implying a read-only operation. While it does not explicitly state 'read-only' or side effects, the description's boundary conditions and lack of mutability language make it sufficiently transparent. A minor deduction for not affirming it is a safe, non-destructive 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?

The description consists of three concise sentences: purpose, usage scenarios, and exclusions. It is front-loaded with the core action, uses no filler, and every sentence adds value. Perfectly structured for quick understanding.

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 simple retrieval tool with one parameter and an output schema (assumed present), the description covers purpose, appropriate usage, and limitations. It explicitly states the document must be in the server's index and not for general advice. No gaps are apparent, making it contextually complete.

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

Parameters2/5

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

The input schema has one required parameter 'document' with 0% schema description coverage, meaning no description in the schema. The tool description mentions 'a specific PDF' but does not explicitly define what the 'document' parameter expects (e.g., document ID, filename). The description fails to add essential semantic meaning beyond the schema, making it difficult for an agent to know how to populate the parameter correctly.

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 'Get document type, retrieval profile, and how to query a specific PDF,' which is a specific verb+resource combination. It distinguishes from sibling tools like search_pdf_context_tool by focusing on document profile metadata rather than full-text search.

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 when-to-use ('when starting work on a named document, when choosing between semantic search vs sequential reading, or when the user asks how a document is classified') and when-not-to-use ('Do not use for documents not in this server's index or for general ML/PDF advice') scenarios, offering clear guidance on appropriate context.

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

get_ingest_status_toolA

Get ingest queue status and health for this MCP server's index.

Use when search returns nothing, the user added new PDFs, ingestion may still be running, or they ask whether documents are ready. Check before assuming a document is missing from the corpus.

Do not use on every message—only when index readiness or failures matter.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

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

No annotations provided, so the description carries full burden. It discloses the tool checks 'status and health' and advises checking before assuming missing documents. It could be more explicit about what 'health' entails (e.g., queue length, errors), but the output schema likely covers this.

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: two sentences plus usage guidelines. The purpose is front-loaded, and every sentence adds value without unnecessary 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?

Given no parameters and an existing output schema, the description is largely complete. It covers when to use and not use, but could provide slightly more detail on what the status/health includes. Still, it is sufficient for an agent to decide when to invoke it.

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?

No parameters in the input schema, so baseline score is 4. The description does not need to add parameter semantics, and it appropriately avoids any redundant information.

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: 'Get ingest queue status and health for this MCP server's index.' It uses a specific verb and resource, and the focus on ingestion status distinguishes it from sibling tools that handle documents, search, and chapters.

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?

Explicitly states when to use ('when search returns nothing, the user added new PDFs, ingestion may still be running, or they ask whether documents are ready') and when not to use ('Do not use on every message—only when index readiness or failures matter'). Provides clear context and exclusions.

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

get_next_chunks_toolA

Read the next sequential chunks in an indexed PDF from a cursor.

Use after get_section_content or a prior get_next_chunks call to continue chapter-by-chapter or page-by-page reading. Pass cursor from the previous response's global_sequence_index.

Do not use for unrelated search queries; use search_pdf_context instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
documentYes
cursorNo
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses the sequential, stateful nature via cursor usage. However, it does not explicitly mention safety (read-only) or potential side effects, though implied.

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?

Four short sentences efficiently convey purpose, usage, cursor handling, and exclusions. No redundant content.

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?

With an output schema present, return values need no explanation. However, given 0% schema coverage, the description should explain document and limit parameters. It covers cursor and usage well but misses parameter details for document and limit.

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

Parameters2/5

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

Schema description coverage is 0%, so description must compensate. It explains the cursor parameter well (pass from previous response's global_sequence_index) but does not explain the document or limit parameters, leaving gaps.

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 reads the next sequential chunks in an indexed PDF using a cursor, using a specific verb and resource. It distinguishes itself from sibling tools like search_pdf_context_tool.

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?

Explicitly states when to use this tool (after get_section_content or prior get_next_chunks call) and when not to (for unrelated search queries, use search_pdf_context instead). Provides clear alternative.

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

get_section_content_toolA

Get ordered text chunks for a chapter or section node in an indexed PDF.

Use for structured reading, teaching a section, or fetching passage text when node_id is known (from list_chapters or list_structure). Prefer over search when the user wants sequential content at a known location.

Do not use without a valid node_id from this document's structure tree.

ParametersJSON Schema
NameRequiredDescriptionDefault
documentYes
node_idYes
offsetNo
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior2/5

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

No annotations provided, so description carries the burden. It mentions 'ordered text chunks' but does not explain ordering criteria, pagination behavior (offset/limit not mentioned), error handling for invalid node_id, or response format. Missing key behavioral traits for a content retrieval tool.

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 covering purpose, usage, and caution. No redundancy, but could be slightly more structured (e.g., separate sections for when-to-use and behavior). Overall efficient.

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 the presence of an output schema, behavior details are partially covered. However, the description lacks explanation for optional parameters and does not differentiate from sibling get_next_chunks_tool. Adequate but with gaps.

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

Parameters2/5

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

Schema description coverage is 0%, so description must compensate. It explains node_id's origin but does not explain the meaning or usage of offset, limit, or document parameters. Offset and limit are critical for pagination but left undocumented.

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', the resource 'ordered text chunks', and the context 'chapter or section node in an indexed PDF'. It distinguishes from sibling search_pdf_context_tool by specifying when to prefer this tool over search.

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?

Explicitly states when to use: when node_id is known from list_chapters or list_structure. Provides a when-not: 'Do not use without a valid node_id from this document's structure tree.' Also suggests preference over search for sequential content at a known location.

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

list_chapters_toolA

List chapters for an indexed PDF (primarily textbooks).

Use when the user asks about chapter numbers, chapter titles, chapter IDs, or page ranges at the chapter level. Pair with get_section_content for reading; note outline end_page may equal start_page—use get_next_chunks to read further.

Do not use for git branches, code modules, or non-PDF structure.

ParametersJSON Schema
NameRequiredDescriptionDefault
documentYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description discloses the behavioral trait that outline end_page may equal start_page, and advises using get_next_chunks to read further. It identifies the tool as chapter listing for indexed PDFs, adding context beyond a minimal description. Could mention prerequisites like indexing status.

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 no wasted words. The first sentence states the purpose directly, followed by usage guidelines and an important note about edge cases. Every sentence adds value.

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 simple input and presence of an output schema, the description is fairly complete. It covers purpose, usage, and an edge case. It could mention error conditions or prerequisites (e.g., document must be indexed), but overall it provides sufficient context for correct tool selection and invocation.

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

Parameters2/5

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

The only parameter 'document' is described as a string but not detailed in the description. Schema coverage is 0%, so the description should clarify the parameter's format or meaning (e.g., document ID, filename). It only implies it identifies a PDF, leaving ambiguity.

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 lists chapters for indexed PDFs, specifically textbooks. It distinguishes from siblings by mentioning pairing with get_section_content and get_next_chunks, and explicitly excludes uses for git branches, code modules, or non-PDF structures.

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?

Provides explicit when-to-use criteria: when users ask about chapter numbers, titles, IDs, or page ranges. Also advises on pairing with other tools and warns about edge cases like equal start and end pages. Includes a clear 'Do not use' list.

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

list_documents_toolA

List PDFs indexed by this MCP server with type and structure summary.

Call first when unsure whether the user's question is about this corpus, when they ask what books/papers are available, or before search when no document name was given.

Do not use for listing files in the git repo or filesystem outside this server's ingested index.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior4/5

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

No annotations are provided, so the description must disclose behavior. It implies a read-only operation by stating 'List...' and describes the output. It does not mention side effects, authorization, or performance, but for a simple listing tool with no parameters, this is adequate.

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 extremely concise with three sentences. The first sentence gives the core purpose, the second provides usage guidance, and the third states an exclusion. No wasted words.

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 no parameters and an output schema exists, the description provides all necessary context: what it does, when to use it, and its limitations. It is complete for an agent to decide when to invoke this 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?

There are zero parameters, so the input schema is fully covered. The description adds value by explaining what the tool lists and what output includes, which is sufficient for a parameterless tool.

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 'List' and resource 'PDFs indexed by this MCP server' and includes what output is provided ('type and structure summary'). It distinguishes from sibling tools which focus on individual documents or search.

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 explicitly instructs to call first when unsure about corpus relevance, when asking about available documents, or before search without a document name. It also states when not to use (listing files outside the index), providing clear usage guidance.

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

list_structure_toolA

Get the full table-of-contents / structure tree for an indexed PDF.

Use when the user needs the complete outline, section hierarchy, or node IDs for navigation—not just top-level chapters.

Do not use for repo directory trees or documents not in list_documents.

ParametersJSON Schema
NameRequiredDescriptionDefault
documentYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

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

No annotations provided, so the description carries full burden. It describes the tool as retrieving structure for indexed PDFs and includes node IDs, indicating a read operation. It does not explicitly state that it is non-destructive or require authorization, but the use context is clear.

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 sentences, front-loaded with the core purpose, followed by usage guidelines and exclusions. 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?

Given the tool's simplicity (one parameter) and the presence of an output schema, the description adequately covers what the tool does, when to use it, and constraints. Could provide slightly more detail on the parameter's nature.

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 has 0% description coverage; the description indirectly explains the document parameter by referencing 'indexed PDF' and 'documents not in list_documents'. However, it does not specify the parameter's format or source, leaving some ambiguity.

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 that the tool retrieves the full table-of-contents/structure tree for an indexed PDF, specifying it provides node IDs for navigation. It distinguishes from siblings by noting it's not just top-level chapters.

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?

Explicitly states when to use (complete outline, section hierarchy, node IDs) and when not to use (repo directory trees, documents not in list_documents). Provides clear guidance on appropriate use cases.

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

reingest_document_toolA

Force re-index of a PDF in this server's corpus.

Use when the user explicitly requests re-ingest, after PDF file changes, or after set_document_type with reingest. Not for routine queries.

Do not use proactively or for code/build tasks.

ParametersJSON Schema
NameRequiredDescriptionDefault
documentYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

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

No annotations are provided, so the description must carry full burden. It mentions 'Force re-index' but does not disclose side effects, permissions required, whether the operation is synchronous or asynchronous, or what happens to existing data. This is insufficient for a mutation tool.

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 three sentences, each serving a distinct purpose: stating the core action, specifying valid usage contexts, and prohibiting misuse. No redundant information.

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 tool has an output schema, so return values are presumably defined there. However, the description does not mention that the document must already exist, or that re-ingestion might affect other processes. It references sibling tool set_document_type but doesn't fully integrate context. Adequate but not thorough.

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

Parameters1/5

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

The schema has a single required parameter 'document' with no description (0% schema description coverage). The tool description also does not explain what format or identifier is expected (e.g., filename, path, or ID). This leaves the agent guessing.

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: 'Force re-index of a PDF in this server's corpus.' It uses a specific verb and resource, distinguishing it from siblings like get_document_profile_tool or list_documents_tool.

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?

Explicitly states when to use: 'when the user explicitly requests re-ingest, after PDF file changes, or after set_document_type with reingest.' Also provides exclusions: 'Not for routine queries. Do not use proactively or for code/build tasks.'

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

search_pdf_context_toolA

Semantic search over PDFs indexed by this MCP server only.

Use when the user asks for facts, quotes, definitions, or comparisons drawn from ingested PDFs; wants page citations; or names a document, chapter, or section in the corpus. Prefer chapter_id/section_id/page filters when scope is known.

Do not use for general world knowledge, repo/code tasks, git, or questions that do not require content from this server's PDF folder. If unsure whether the question is about indexed PDFs, call list_documents first.

ParametersJSON Schema
NameRequiredDescriptionDefault
questionYes
top_kNo
documentNo
chapter_idNo
section_idNo
structure_node_idNo
page_startNo
page_endNo
doc_typeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden. It transparently describes the tool's behavior (semantic search, page citations, filter usage). However, it does not explicitly state read-only nature or potential limitations like rate limits.

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 5 sentences front-loaded with the purpose. No redundancy. Could be slightly more streamlined, but overall efficient.

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 the high parameter count (9) and no annotations, the description lacks details on several parameters (top_k, structure_node_id, doc_type). It also does not describe the output format beyond 'page citations'. Incomplete for a complex tool.

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

Parameters2/5

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

Schema description coverage is 0%. The description only briefly mentions 'chapter_id/section_id/page filters' but does not detail parameters like top_k, structure_node_id, doc_type, or how to use them. Missing parameter guidance reduces usefulness.

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 'Semantic search over PDFs indexed by this MCP server only', specifying the verb (search) and resource (PDFs). It distinguishes itself from sibling tools that deal with listing or ingestion.

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?

Provides explicit when-to-use scenarios (facts, quotes, definitions, page citations, named sections) and when-not-to-use (general knowledge, code tasks). Includes an alternative action: 'call list_documents first' if unsure.

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

set_document_type_toolA

Override auto-classified document type for an indexed PDF.

Use only when the user explicitly asks to change doc_type or when misclassification is confirmed and affects retrieval. Set reingest=true only if they want chunks re-built under the new profile.

Do not use proactively on every document or for repo configuration tasks.

ParametersJSON Schema
NameRequiredDescriptionDefault
documentYes
doc_typeYes
reingestNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the effect of reingest: 'Set reingest=true only if they want chunks re-built under the new profile.' It does not mention reversibility or side effects on retrieval, but the core behavioral trait (overriding doc_type and optionally reindexing) is covered. Could be slightly more detailed but sufficient.

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 efficient sentences. The first sentence states purpose, the second provides usage conditions, the third explains a parameter's effect. No fluff, front-loaded with the most critical information.

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's simplicity (3 params) and the presence of an output schema (so return values are covered), the description is complete. It covers purpose, usage, and parameter behavior. It clearly distinguishes from siblings like reingest_document_tool and search_pdf_context_tool.

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 0%, so description must compensate. It adds meaning to 'reingest' by explaining its effect. For 'doc_type', it implies it's the new type to assign. However, 'document' is not further explained (identifier format or source), leaving some ambiguity. The description partially compensates but not fully for all three parameters.

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: 'Override auto-classified document type for an indexed PDF.' It specifies the verb (override), resource (document type), and context (indexed PDF). It also distinguishes itself from siblings like reingest_document_tool by focusing on changing doc_type rather than just reingesting.

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?

Explicitly states when to use: 'only when the user explicitly asks to change doc_type or when misclassification is confirmed and affects retrieval.' Also provides a clear condition for a parameter (reingest) and a don't-use case: 'Do not use proactively on every document or for repo configuration tasks.' This sets strong boundaries.

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. 10 tool updatesv0.1.1
    • First observedget_document_profile_tool
    • First observedget_ingest_status_tool
    • First observedget_next_chunks_tool
    • First observedget_section_content_tool
    • First observedlist_chapters_tool
    • First observedlist_documents_tool
    • First observedlist_structure_tool
    • First observedreingest_document_tool
    • First observedsearch_pdf_context_tool
    • First observedset_document_type_tool

TDQS

A4.2/5.0
Disambiguation5/5

Each tool targets a distinct operation: document listing, chapter listing, structure browsing, sequential reading, semantic search, ingestion status, type management, re-ingest, and profile retrieval. No two tools have overlapping purposes; descriptions clearly delineate usage.

Naming Consistency5/5

All tool names follow a consistent verb_noun_tool pattern (e.g., list_documents, get_section_content, search_pdf_context). Verbs are uniform (get, list, search, reingest, set), providing predictable navigation for an agent.

Tool Count5/5

With 10 tools, the server covers all core PDF management operations—ingestion, navigation, search, and configuration—without overloading. The count feels appropriate for the domain and avoids unnecessary complexity.

Completeness4/5

The tool surface covers the essential lifecycle: list/search documents, navigate structure, read chunks, manage ingestion, and set document types. A minor gap is the lack of a delete/remove tool, but this is acceptable for a retrieval-focused server.

Maintenance

ActivityStale
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

  • F
    license
    Not graded
    quality
    D
    maintenance
    A local-first MCP server that enables semantic search over PDF and DOCX documents using structure-aware parsing and vector storage. It allows users to query their local knowledge base through Claude Code without cloud dependencies or GPU requirements.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    A local-first semantic search server for documents, supporting PDFs, Office files, and text/markdown, enabling natural language search via the Model Context Protocol (MCP).
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A local MCP server that extracts text-layer content from PDF files, enabling AI agents to inspect, extract text, outlines, and page content.
    -

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/mematcha/pdf-context'

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