Skip to main content
Glama
formfeed

formfeed

Official

Redact a PDF

redact_pdf

Permanently remove text, image pixels, links, and comments from PDFs by specified regions or text matches, and verify redaction before returning the file.

Instructions

Removes what lies under rectangles of the pages, and every place where a text stands, from the file itself and not just from view: text, the pixels of images under a rectangle, and links and comments it touches. The result is read again: a text that can still be found fails the call with redaction_incomplete, which names rectangles and texts by their number, and nothing is delivered. Rectangles are points from the top-left corner of the page as a viewer shows it, 72 to an inch; get_pdf_info gives the page sizes and pdf_to_image a picture of the page. A text is found whatever its spacing, ignoring case unless match_case is true. A black box is drawn over each removed place, another colour with fill, none with fill null. Pass exactly one PDF: source, a render or library file of the workspace; path, a file on this machine; or file_base64. Starter plan and above; 0.5 units on a live key. The texts are never stored.

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": "redact_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
fillNoColour of the box drawn over each removed place, #000000 when left out; null draws none
pathNoAbsolute path of a PDF on this machine, up to 100 MB; sent with the request and not kept
textNoTexts to remove wherever they stand, such as a name or an IBAN, found whatever their spacing
sourceNoA PDF of the workspace: the rnd_ id of a PDF render, or a PDF of the file library by name (such as terms.pdf) or fil_ id
regionsNoThe rectangles to remove, as a viewer shows the page; give regions, text or both
filenameNoName of the file behind download_url; the source's name when left out
file_nameNoName of the PDF given as file_base64 or path, e.g. contract.pdf; the results are named after it
match_caseNoFind a text only in the case it is written in
file_base64NoThe PDF itself, base64 encoded, up to 20 MB; sent with the request and not kept
whole_wordsNoFind a text only where a word boundary stands on each side

Output Schema

NameRequiredDescriptionDefault
idYesrnd_ id of the render
formNoWhat fill_pdf_form did: the fields filled, those left out (unknown name or invalid value) and those whose calculation or display format no viewer ran
pdfaNoThe PDF/A verdict (PDF/A-2b or PDF/A-3b), when the template declares it
errorYesWhy a failed render failed
unitsYesUnits the render counted
outputNoThe format of the file: pdf, png, jpg, webp, docx or pptx, or zip for the several files of split_pdf and pdf_to_image
statusYes
einvoiceNoThe e-invoice report, when the render made one
templateYesThe template and version rendered; null for html and conversions
expires_atYesWhen download_url stops working; get_render issues a fresh one
page_countYes
environmentYes
download_urlYesSigned link to the file; null until the render succeeded
accessibilityNoThe PDF/UA-1 verdict, when the template declares it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.26

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the post-write verification pass, the redaction_incomplete failure with named rectangle and text numbers and no delivered file, the black-box default versus fill for another colour or null for none, the coordinate convention in points from the top-left, and that the texts are never stored. It also states the plan tier and 0.5-unit live-key cost. 'Removes ... from the file itself' reads as producing a redacted output rather than mutating the source, which is consistent with destructiveHint=false and a download_url being returned.

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 what is removed and what gets destroyed, then verification, geometry, styling, input selection, and cost, in a sensible order. The sentences are long and dense with subclauses, which costs some readability, but almost every clause carries operational 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?

For a ten-parameter destructive-looking operation with an output schema, the definition covers what an agent needs: inputs and their mutual exclusion, geometry conventions, outcome styling, the failure mode and its error code, storage guarantees, plan gating, and cost. Return-value detail is correctly left to the output schema.

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 meaning the schema cannot express: the exactly-one-of constraint among source, path, and file_base64, which is absent because no parameters are required. It also pins down the coordinate frame for regions (points from the top-left, 72 to the inch) and repeats the fill conventions, so the caller can construct values 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?

States a specific verb and resource: it removes content from a PDF at two kinds of target, rectangles and text occurrences, and removes it from the file rather than only from rendering. It also names the sibling tools that supply its inputs (get_pdf_info for page sizes, pdf_to_image for a page picture), so an agent can place it in a workflow without opening another schema.

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?

Gives clear preconditions: pass exactly one PDF via source, path, or file_base64, and supply regions, text, or both. It routes the agent to get_pdf_info and pdf_to_image to obtain the coordinate frame before calling. It stops short of an explicit when-not-to-use statement, though no sibling appears to compete for the same task.

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