Skip to main content
Glama

Api2Pdf MCP by usefulapi

Extract PDF pages (PDFSharp)

api2pdf_extract_pages
Destructive

Extract a range of pages from an existing PDF (given as a URL) into a new PDF. start/end are 0-based page indices; omit end to extract a single page. Returns a { FileUrl } (valid ~24h). BILLED. Api2Pdf API: POST /pdfsharp/extract-pages.

Input Schema

NameRequiredDescriptionDefault
endNo0-based index of the last page to extract. Omit for a single page (just `start`).
urlYesURL of the source PDF.
startNo0-based index of the first page to extract. Default 0.
inlineNoIf true (Api2Pdf default), the generated file is served inline; if false, as an attachment.
optionsNoEngine-specific render options (page size, margins, orientation, headers/footers, etc.). Passed through verbatim to Api2Pdf.
storageNoCustom storage target, used when useCustomStorage is true.
fileNameNoA name for the generated file, e.g. 'invoice.pdf'.
output_binaryNoIf true, return the raw file bytes as base64 instead of a FileUrl. Default false (recommended for agents — returns a short-lived link).
extraHTTPHeadersNoExtra HTTP headers Api2Pdf forwards when it fetches a source URL (e.g. auth for a protected page/file).
useCustomStorageNoIf true, Api2Pdf uploads the result to your own storage (see `storage`) instead of hosting it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With only destructiveHint in the annotations, the description carries real additional weight: it discloses that the call is BILLED, that the result is delivered as a { FileUrl } valid ~24h, and that indices are 0-based. It omits auth/permission requirements and any note that options/storage/useCustomStorage alter the output path, so it is good but not complete.

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?

Three tight sentences, front-loaded with the operation, then the indexing rule, then the return contract and billing flag. The terse 'BILLED.' and endpoint line earn their place without padding.

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

Completeness4/5

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

For a 10-parameter tool with nested objects (options, storage) and no output schema, the description covers the return value, its lifetime and the billing model, which is the critical missing piece. It does not address error cases (e.g. out-of-range indices) or authorization for protected source URLs.

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 schema already documents url, start, end, storage, inline, options, fileName, output_binary, extraHTTPHeaders and useCustomStorage. The description's 0-based index and omit-end notes merely restate the schema, so this sits at the baseline.

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 names a specific verb+resource ('Extract a range of pages from an existing PDF ... into a new PDF') and pins the input form (URL), which cleanly separates it from siblings like api2pdf_merge_pdfs or api2pdf_compress_pdf. It also identifies the underlying endpoint (POST /pdfsharp/extract-pages).

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?

Usage context is clear: page-range extraction from a URL-hosted PDF, with the 'omit end for a single page' case explained. It does not, however, name when to prefer a sibling (e.g. merge/compress) or state any exclusion or prerequisite such as auth on the source URL.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.