Skip to main content
Glama
Paperboy

Paperboy

Official
by sudostash

extract_attachments

DestructiveIdempotent

Save embedded files from a PDF into a folder, all or selected by name, while skipping executable attachments unless explicitly allowed.

Instructions

Save files embedded in a PDF into a folder (default: "_attachments" next to it): all of them, or those named (see list_attachments). Names are made safe to use as file names; prefer a new folder, since saved files can have any name. Attachments that can run on a computer (programs, scripts, ...) are skipped unless allow_executables=true; only set that if the user asked for them. Files that are damaged, over the file size limit or in an unsupported encoding are listed in skipped, as are files past a total of 4x that limit per call; only the first 1,000 attachments are read (truncated). Saved files are not password-protected, even if the PDF is. Needs the owner password if the PDF forbids copying.

Any password argument can be "ask": the user then types it on a local page, so it never passes through the chat.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "input_path": "<input_path>"
    },
    "name": "extract_attachments"
  }
}

Input Schema

NameRequiredDescriptionDefault
namesNo
passwordNo
overwriteNo
input_pathYes
output_dirNo
allow_executablesNo

Output Schema

NameRequiredDescriptionDefault
filesYes
skippedYes
truncatedYes
output_dirYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.1

TDQS

A4.6/5.0
Behavior5/5

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

With only generic annotations (destructive, idempotent, not read-only), the description carries its weight: it discloses filename sanitization, executable skipping, the skipped list for damaged/oversized/unsupported files, a 4x total size cap, a 1,000-attachment truncation, that saved files are not password-protected, and the owner-password requirement when copying is forbidden.

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?

Information is front-loaded and each clause carries real content, though the parenthetical asides and the trailing password note make it dense rather than crisp. No sentence is pure padding.

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 six-parameter write tool with an output schema, the description covers the risky behaviors, limits, password flow, and skip semantics that the schema and annotations do not. Return values are covered by the output schema, so nothing essential is missing.

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 0%, so the description must explain the parameters, and it does for names, output_dir (default '<name>_attachments' next to the PDF), allow_executables, and password including the special 'ask' value. The overwrite parameter is only indirectly implied ('prefer a new folder'), leaving one gap.

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 opens with a specific verb and resource ('Save files embedded in a PDF into a folder'), states the default output location, and distinguishes itself from the sibling list_attachments by pointing to it for name discovery.

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?

Clear guidance on when to enable allow_executables ('only set that if the user asked'), a recommendation to use a fresh folder, and a pointer to list_attachments for choosing names. It stops short of stating exclusions such as when to prefer list_attachments over extracting, but the practical routing is present.

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