Skip to main content
Glama

Redact PDF Text

redact_by_text_range

Redact PDF text by specifying the exact text to remove on each line.

MANDATORY WORKFLOW — follow every step in order before calling this tool:

Step 1 — Retrieve line text: Call list_redactable_line_text and note the exact 'text' string and 'line_index' for every line you intend to redact.

Step 2 — Identify the text to redact: Provide the exact substring to remove. The value must appear verbatim in the line's 'text' field. - Non-CJK text (e.g. English): whole-word matching is enforced. "the" will NOT redact text inside "then", "there", or "either". - CJK text (e.g. Chinese): substring matching — "王大明" will match wherever it appears in the line.

Step 3 — Build the content payload: Group redaction targets by page. Each page entry contains a list of { line_index, text } pairs.

Example:
    content = [
        {
            "page_index": 1,
            "lines": [
                {"line_index": 3, "text": "John Doe"},
                {"line_index": 7, "text": "confidential"}
            ]
        }
    ]

Step 4 — Verify and re-redact if needed: After this tool returns, you MUST call list_redactable_line_text again with the NEW job_id to verify that all intended targets have been removed. If any target text still appears in the result, call redact_by_text_range again immediately with the remaining targets. Repeat until all targets are gone — do NOT report success until the verification confirms zero remaining targets.

Creates a NEW job_id (with parent_job_id linking to the source). After redaction completes, call 'view_pdf' with the new job_id to display the result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesJob ID of the PDF to redact (use the latest job_id).
contentYesList of pages to redact. Each item must include: - page_index (int): 1-based page number. - lines (list): each entry contains: - line_index (int): line index from list_redactable_line_text. - text (str): exact text to redact from that line.
session_idYesSession ID that the job belongs to.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYes
filenameYes
mime_typeYes
reply_noteYes
session_idYes
download_urlYes
instructionsYes
parent_job_idYes

TDQS

A4.9/5.0
Behavior5/5

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

The description discloses important behavioral details beyond the annotations: exact substring matching requirements, whole-word vs. substring behavior for non-CJK vs. CJK text, the creation of a new job_id with parent_job_id linkage, and a mandatory verification loop. These are significant operational traits that an agent would not know otherwise.

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?

The description is long but well-structured, with a clear step-by-step workflow and an illustrative example. Every section adds necessary operational detail; however, some repetition around verification could be tightened without losing value.

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?

Given the complexity of the tool, the description is remarkably complete: it covers the full workflow, matching rules, example payload, job_id behavior, verification requirements, and the follow-up view_pdf step. Since an output schema exists, the description does not need to explain return values, and it thoroughly covers all other context.

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?

Although schema coverage is 100%, the description adds crucial meaning: page_index is 1-based, line_index comes from list_redactable_line_text, the text must match verbatim, and the content structure groups targets by page. This enrichment goes well beyond the bare schema definitions and ensures correct payload construction.

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: 'Redact PDF text by specifying the exact text to remove on each line.' It distinguishes itself from siblings like list_redactable_line_text (which retrieves text) and delete_pdf_page (which removes pages) by focusing on text-level redaction per line.

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?

The description provides a mandatory workflow with explicit steps: call list_redactable_line_text first, build the payload, then verify by calling list_redactable_line_text again and re-redact if needed. This clearly instructs when to use the tool and how it relates to sibling tools, leaving no ambiguity about prerequisites or follow-up actions.

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.

TDQS

A4.2/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: uploads are split by context (single, batch, widget), content inspection is split by method (text, images, redaction lines), and password operations are split by state (set vs change). Descriptions explicitly cross-reference to prevent confusion.

Naming Consistency4/5

All tools start with a verb (upload, check, compare, compress, create, delete, get, list, redact, set, change, view), but the position of 'pdf' varies (suffix in compress_pdf, middle in get_pdf_info) and some names are compound like 'batch_upload_pdf' and 'get_latest_comparison'. Pattern is readable but not perfectly uniform.

Tool Count4/5

16 tools is slightly above the ideal 3-15 range, but each tool maps to a distinct operation or workflow step in PDF handling. The count feels justified given the breadth of features (upload, compress, delete, password, redact, compare).

Completeness4/5

The surface covers the core PDF lifecycle: upload, view, compress, delete pages, password protection, redaction, and comparison. Minor gaps exist (no merge, split, or rotate), but the primary workflows are fully supported with mandatory pre/post checks.