Skip to main content
Glama

Extract text from files

extract_file_text

Turn files into text on the server: a PDF (its text layer, or OCR for scanned pages), or photos or scans of pages (one image per page, in reading order). Also reads plain-text files.

Use it before import_script for a screenplay that arrives as a PDF or as page images: then call import_script with the textId this returns. Never retype a long script with edit_script. For notes and other documents, read the returned text.

Pages with a text layer are free. Each page read by OCR costs about half a credit; when more than 20 pages need OCR, the call returns confirmation_required with the estimate: ask the user, then call again with confirm: true. At most 300 pages per file are read.

Returns the textId, per file the pages read by text layer and by OCR and any failedPages, the OCR spend of this call, and the text in pages of 60000 characters (pass nextOffset as offset for the next page). Calling again with the same files costs nothing for pages already read and retries failed pages.

Input Schema

NameRequiredDescriptionDefault
urlsNohttps URLs of the files, in reading order: one PDF, or one image per page.
offsetNoCharacter offset of the text to return (nextOffset of the previous call).
confirmNoTrue once the user agreed to the OCR estimate (needed above 20 pages to transcribe).
projectIdYesScreenWeaver project id (from list_projects).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations: it discloses the cost model (text-layer pages free, OCR ~half a credit per page), the >20-page OCR confirmation flow via confirmation_required and confirm: true, the 300-page cap, and retry semantics where re-submitting the same files is free for already-read pages and only retries failures. The annotations only say readOnlyHint=false and destructiveHint=false, so this text carries the real behavioral load.

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?

Purpose and the import_script handoff are front-loaded, and no sentence is filler. It is dense, however: cost, confirmation, limits, and return-shape details are packed into one uninterrupted block, which makes scanning harder than it needs to be.

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?

There is no output schema, so the description supplies the return contract itself: textId, per-file pages read by text layer vs OCR, failedPages, the OCR spend of the call, and text chunked into 60000-character pages with nextOffset. Combined with the cost and confirmation rules, an agent has everything needed to call and re-call the tool 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?

Schema coverage is 100%, so the baseline is 3, but the description adds operational meaning: confirm is tied to the user-agreed OCR estimate above 20 pages, and offset is tied to the returned nextOffset for paginated text. Remaining parameters (urls, projectId) are left to the schema, which already documents them.

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 states a specific verb and resource ('Turn files into text on the server') and immediately enumerates the accepted inputs: a PDF's text layer, OCR of scanned pages, page images in reading order, and plain-text files. It is unmistakable against siblings like import_script, edit_script, or view_media.

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?

Explicit routing: use it before import_script when a screenplay arrives as PDF or page images, then pass the returned textId to import_script; it also names a prohibition ('Never retype a long script with edit_script') and covers the non-screenplay case ('For notes and other documents, read the returned text'). Both the when and the when-not are stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.