Skip to main content
Glama

notion_extract_file_text

Extract text from PDFs located in Notion, shared mounts, local paths, or Drive without moving bytes over MCP. Supports OCR for scanned/image-only PDFs.

Instructions

Extract text from a PDF anywhere notion-mcp can reach — a file stored in Notion, the shared cross-MCP mount, the private store, or the Drive folder — without moving the bytes over MCP.

source schemes: 'notion:' (file/pdf block on a page — get block IDs from notion_list_files_on_page), 'shared:', 'local:', 'drive:'.

Returns JSON: {"text", "page_count", "pages_returned", "mode", "truncated", "filename"} (+ "ocr_used"/"ocr_pages"/"ocr_engine" when OCR ran). Response ceiling 200 KB — truncation happens on a page boundary with a trailing marker naming the pages to fetch next.

pages: pdftotext-style spec — None/"" (all), "3", "1-5", "1,3,5", "1-3,7". Out-of-range pages are silently dropped. mode: 'text' (flowing), 'layout' (preserve columns), 'tables' (extract_tables → markdown). Applies to native extraction only.

OCR (scanned / image-only PDFs) — delegated to the fleet xberg service (XBERG_BASE_URL env; pages rasterised locally, sent as PNGs): ocr='auto' (default) — pages whose native text is < 20 chars are OCR'd (tesseract backend, seconds/page). "ocr_error" in the response means OCR was needed but xberg was unreachable/failed. ocr='off' — native extraction only. ocr='force' — OCR every requested page (garbled font encodings). ocr='llm' — transcribe pages with a vision model (xberg vlm backend → LiteLLM; env: XBERG_VLM_API_KEY, optional XBERG_VLM_MODEL / XBERG_VLM_BASE_URL). Best for handwriting and messy tables; slower and metered.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ocrNoauto
modeNotext
pagesNo
sourceYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It excels by detailing response truncation (200 KB ceiling, page-boundary truncation, trailing marker), silent dropping of out-of-range pages, OCR auto behavior with a 20-char threshold, error conditions ('ocr_error'), and the distinction between native and OCR extraction. These details go far beyond what the schema or annotations reveal.

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 long but densely informative, with every section providing necessary operational detail. It is front-loaded with the core purpose and then structured into paragraphs and enumerations for source schemes, return format, page specs, mode, and OCR, making it navigable despite its length.

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?

Despite the presence of an output schema, the description goes beyond it by explicitly listing the returned JSON fields and explaining truncation behavior. It covers all four parameters, source access, mode semantics, OCR fallback conditions, and error signaling, leaving no material gap for an agent to invoke the tool correctly.

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?

Since schema description coverage is 0%, each parameter is thoroughly explained in prose: source includes scheme-specific examples, pages uses a pdftotext-style grammar with concrete examples, mode enumerates 'text', 'layout', and 'tables' with explanations, and ocr documents 'auto', 'off', 'force', and 'llm' with detailed behavior. This fully compensates for the absent 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's function: "Extract text from a PDF anywhere notion-mcp can reach" and distinguishes it by noting it does so "without moving the bytes over MCP." It also specifies supported source schemes and references companion tool notion_list_files_on_page, making the resource and scope unambiguous.

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 clear contextual guidance: it explains the acceptable source schemes, how to obtain block IDs (via notion_list_files_on_page), and when to use different modes and OCR settings. However, it does not explicitly contrast with alternative sibling tools (e.g., notion_download_file) or state when not to use this tool, so it falls short of full alternative-based guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

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

curl -X GET 'https://glama.ai/api/mcp/v1/servers/snickery/notion-mcp'

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