Skip to main content
Glama

Update pdf text

update_pdf_text
Destructive

Put one page of a PDF's recognized text right — a formula Mathpix misread, a broken paragraph, a table. Read the page first with read_pdf_text and pass its 'version' as expected_version: if somebody saved the page since, nothing is written and the answer says the version there is now. 'text' is the page's whole new text, Markdown with $…$ formulas, at most 100,000 characters. It is kept as a new version of the page with its history, as an agent on behalf of the person whose token this is; a person may revert it to the machine's text. An agent never marks a page «checked by a person» — that is a person's word on the screen. Compare with pdf_page_image of the same page before writing. Requires permission to edit the wiki page the file is on.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "page": "<page>",
      "text": "<text>",
      "expected_version": "<expected_version>"
    },
    "name": "update_pdf_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageYesThe page of the original, from 1.
textYesThe page's whole new text.
fileIdNoThe file's id.
pageIdNoWiki page id, with 'filename', instead of fileId.
filenameNoThe PDF's name on that page.
expected_versionYesThe page's 'version' as read_pdf_text gave it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/readOnlyHint annotations: it discloses optimistic concurrency behavior on version mismatch (nothing is written and the current version is returned), versioned history with revertability by a person, that the write is attributed to the token owner, and the permission requirement. This is exactly the kind of consequence detail a destructive write tool needs.

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?

Front-loaded with the purpose, then prerequisites, payload format, and side effects in a logical order, with no filler sentences. Some clauses are dense and run long, and the file-identification note is missing rather than omitted for economy.

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?

For a 6-parameter destructive write with no output schema, the description covers failure modes, format limits, permissions, and reversibility. The main gap is how to identify the target file (fileId vs pageId plus filename) and whether any page-number edge cases exist.

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 real semantics the schema lacks: expected_version is a concurrency guard obtained from read_pdf_text, and text is the page's entire new text in Markdown with $…$ formulas capped at 100,000 characters. It does not explain when to use fileId versus pageId+filename, which the schema only hints at.

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?

States a specific verb and resource — correcting one page's recognized PDF text — with concrete examples (misread formula, broken paragraph, table). It also implicitly distinguishes itself from read_pdf_text (the reader) and pdf_page_image (the visual check), so an agent can place it among the ~200 siblings.

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?

Gives an explicit precondition ('Read the page first with read_pdf_text and pass its version as expected_version'), a verification step ('Compare with pdf_page_image of the same page before writing'), and an authority prerequisite ('Requires permission to edit the wiki page the file is on'). It also states what the agent must NOT do (mark a page as checked by a person).

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