Skip to main content
Glama

Recognize pdf

recognize_pdf
Destructive

Read a PDF on a wiki page with its formulas by Mathpix, on the project's own Mathpix key — which costs the project money, per page. First call it with estimate_only=true: it answers the pages, the price a page (with the day it was checked, and whether it is the platform's or the project's own) and the sum. Then call again with max_usd at least that sum, which is the most you agree to spend; without it nothing is sent, and a send that would cost more is refused. Optional 'pages' reads a range — a chapter of a book. The reading runs in the background: list_pdf_copies / read_pdf_text say when it is done and how many pages Mathpix billed. Refused when the project has no key (it is set on the project's screen only, never here) or its pages for the day are spent. Requires permission to write in the project.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "recognize_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
pagesNoA page or a range to read: '5', '3-7'. The whole file without.
fileIdNoThe file's id (list_pdf_copies).
pageIdNoWiki page id, with 'filename', instead of fileId.
max_usdNoThe most you agree to spend, in US dollars — at least the estimate.
filenameNoThe PDF's name on that page.
estimate_onlyNoTrue: only say what it would cost, send nothing.
replace_editsNoPages people or agents edited keep their edits by default, the new reading beside them to compare; true replaces those edits with the new reading (their history stays). The estimate's editedPages says how many there are.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / replace_edits
      Added value: +{
      +  "default": false,
      +  "description": "Pages people or agents edited keep their edits by default, the new reading beside them to compare; true replaces those edits with the new reading (their history stays). The estimate's editedPages says how many there are.",
      +  "type": "boolean"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only flag destructiveHint=true and readOnlyHint=false; the description goes much further, disclosing the real money cost per page, the hard spend gate (no max_usd = nothing sent; over-estimate = refused), background execution, and the refused states (no project key, daily pages spent). It also spells out the destructive behavior concretely — replace_edits=true overwrites people's edits, though their history survives — and requires project write permission.

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?

It is a single dense paragraph that front-loads the cost/consent workflow before the refusal conditions, and nearly every sentence carries a fact an agent needs. Some phrasing is run-on (the parenthetical about whose key it is, the trailing permission sentence), but nothing is redundant filler.

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 costly, destructive, externally-billed, background-executing tool with no output schema, the description covers everything that affects a correct call: prerequisites (project key, write permission), the two-step cost gate, page-range semantics, edit-replacement semantics, and where to check results and billed pages.

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 schema already defines all seven parameters and a baseline 3 would be defensible. The description still adds decision-relevant meaning: pages as a range like a chapter, max_usd as a consent ceiling tied to the estimate, and estimate_only as a mandatory first step rather than a convenience flag.

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 opening clause names a specific verb and resource — reading a PDF on a wiki page into formulas via Mathpix — plus the scope that matters (the project's own key, billed per page). It is distinguishable from read_pdf_text and search_pdf_texts, which the description implicitly positions as status/retrieval tools rather than OCR producers.

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?

It gives an explicit, ordered procedure: call first with estimate_only=true, then call again with max_usd at least the quoted sum, and it names the state in which nothing is sent. It also names list_pdf_copies and read_pdf_text for checking completion. What it does not state is when to prefer this over already-available text (read_pdf_text/search_pdf_texts) — presumably only when no reading exists — leaving that inference to the agent.

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.

Resources