Skip to main content
Glama

download_pdf

Download a PDF from a URL to local storage. URL is checked for SSRF safety and PDF magic bytes. Optionally specify a DOI or filename. Size limit 100 MB.

Instructions

Download a PDF to the local PDF directory. Use find_oa_pdf first to obtain a URL. The URL is validated for SSRF safety (private/loopback/metadata IPs are refused) and the bytes are verified to start with the %PDF- magic marker. Downloads are capped at PDF_MAX_BYTES (default 100 MB) and written atomically — a failed download never leaves a partial file at the final path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doiNoDOI used to derive the filename (optional).
urlYesDirect PDF URL (typically best_oa_location.url_for_pdf from find_oa_pdf).
filenameNoExplicit filename override (sanitized; will be .pdf-suffixed).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
doiNo
urlYes
local_pathYes
content_typeNo
bytes_writtenYes
Behavior5/5

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

With no annotations provided, the description bears the full burden of disclosure. It comprehensively details behavioral traits: SSRF safety validation (refusing private/loopback/metadata IPs), magic marker verification (%PDF-), size cap (PDF_MAX_BYTES, default 100 MB), and atomic write semantics. This fully informs the agent of safety and correctness guarantees.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is four sentences long, front-loaded with the core purpose, and contains zero superfluous words. Every sentence adds critical information about workflow, validation, or guarantees. It is optimally sized for quick consumption.

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 tool has an output schema (reducing need to describe return values) and relatively low complexity (3 parameters, 1 required), the description covers all essential aspects: prerequisite step, safety checks, size limit, and atomicity. It leaves no major behavioral gaps for a download tool.

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?

Schema description coverage is 100%, so the baseline is 3. The description does not add new parameter-level meaning beyond the schema, focusing instead on URL processing behavior. It does not elaborate on how `doi` or `filename` are used beyond the schema descriptions, so no uplift is warranted.

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 action ('Download a PDF to the local PDF directory'), identifies the resource type (PDF), and distinguishes from siblings by explicitly referencing the prerequisite tool `find_oa_pdf`. The verb-resource combination is specific and unambiguous.

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 explicit when-to-use guidance by instructing practitioners to first use `find_oa_pdf` to obtain a URL. This frames the tool as the second step in a two-step workflow, making its context clear. No alternatives are needed as the sibling tools cover different use cases.

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/Scentless-trick128/openpapers-mcp'

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