Skip to main content
Glama
pdf4me
by pdf4me

Find And Replace Text

find_and_replace_text

Find and replace text in a PDF file. Specify old and new text, optionally target specific pages to edit PDF content.

Instructions

Find and replace text in a PDF via PDF4me /api/v2/FindAndReplace. Inputs: pdf_file_path, old_text, new_text, page_sequence; optional output path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
new_textYes
old_textYes
output_dirNo
page_sequenceNo1
pdf_file_pathYes
output_file_nameNo
request_doc_nameNo
Behavior2/5

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

With no annotations provided, the description carries the full burden of disclosing behavior. It states 'Find and replace text' but does not clarify whether it operates on the original file or creates a new one, whether it replaces all occurrences or only the first, or how the 'page_sequence' parameter affects the operation. The mention of an 'optional output path' hints at a new output file, but this is not explicit. Significant behavioral gaps remain.

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 a single concise sentence that front-loads the primary function. The API endpoint reference ('via PDF4me /api/v2/FindAndReplace') is extra detail that could be omitted, but overall the text is efficient and avoids excessive length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 7 parameters, no annotations, no output schema, and a complex sibling set, the description is insufficient. It fails to explain return values, side effects, or all parameter meanings. A user would likely need external documentation to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It names only four parameters (pdf_file_path, old_text, new_text, page_sequence) and vaguely references 'optional output path', omitting output_dir, output_file_name, and request_doc_name. It does not explain the format or meaning of page_sequence (e.g., comma-separated pages). The provided parameter list adds minimal value beyond the schema.

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: 'Find and replace text in a PDF'. It uses a specific verb ('replace') and resource ('text in a PDF'), which distinguishes it from sibling tools like 'replace_text_with_image' (replacing text with images) and 'add_text_stamp_to_pdf' (adding text stamps). The inclusion of the API endpoint and key inputs reinforces the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives. It does not mention exclusions or conditions, such as 'use this for text-to-text replacement; for replacing text with images, use replace_text_with_image instead'. The description merely lists inputs without contextual usage advice.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pdf4me/pdf4me-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server