Redact PDF Text
redact_by_text_rangeRedact 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
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | Job ID of the PDF to redact (use the latest job_id). | |
| content | Yes | List 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_id | Yes | Session ID that the job belongs to. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | ||
| filename | Yes | ||
| mime_type | Yes | ||
| reply_note | Yes | ||
| session_id | Yes | ||
| download_url | Yes | ||
| instructions | Yes | ||
| parent_job_id | Yes |