Skip to main content
Glama
pdf4me
by pdf4me

extract_attachment_from_pdf

Extract embedded file attachments from PDFs and save them to your local drive, either as individual files or a JSON manifest.

Instructions

Extract embedded file attachments from a PDF via PDF4me ExtractAttachmentFromPdf (/api/v2/ExtractAttachmentFromPdf). pdf_file_path; optional output_dir (defaults next to PDF). Saves extracted_attachments.json when JSON, decodes outputDocuments to files, or saves/extracts ZIP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_dirNo
pdf_file_pathYes
request_doc_nameNo
Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden. It reveals concrete output behavior: saving extracted_attachments.json for JSON, decoding outputDocuments to files, or saving/extracting ZIP archives. This goes beyond the schema and tool name, though it does not cover error handling, permissions, or whether the source PDF is modified.

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 concise, with two sentences and no filler. It front-loads the core action and API endpoint, then packs output handling into the second sentence. The dense comma-separated clauses reduce readability slightly, but every word contributes meaningful information.

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

Completeness3/5

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

The description covers the primary operation and output handling adequately, but gaps remain: request_doc_name is unexplained, there is no usage guidance versus alternatives, and no output schema exists to describe return values. For a tool with three params and no annotations, it is serviceable but not fully complete.

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

Parameters3/5

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

The schema has 0% description coverage, so the description must compensate. It explains pdf_file_path and output_dir (including the default behavior 'next to PDF'), but completely omits request_doc_name, leaving its purpose and use unclear. The partial coverage is useful but not fully sufficient for a schema with three undocumented parameters.

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 explicitly states the tool's action: 'Extract embedded file attachments from a PDF', naming both the verb and the resource. It also includes the specific PDF4me API endpoint, making the purpose unambiguous and distinct from sibling tools like extract_pages_from_pdf or extract_text_from_pdf.

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?

There is no explicit guidance on when to use this tool versus sibling extraction tools, nor any mention of alternatives or exclusions. The description focuses on mechanics (e.g., output_dir default) rather than selection criteria, leaving the agent to infer usage from the tool name alone.

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