Skip to main content
Glama

PDF Efforts

Extract PDF pages

extract_pages
Idempotent

Create a new PDF containing only the selected pages, in the order given (e.g. "5, 1, 2" starts with page 5).

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": {
      "file": "<file>",
      "pages": "<pages>"
    },
    "name": "extract_pages"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe PDF.
pagesYesPages to keep, in this order: "all", or numbers and ranges such as "1-3, 5, 8-end" ("end" = last page).

Output Schema

NameRequiredDescriptionDefault
infoNoFacts about the PDF (get_pdf_info) or the result (e.g. target_met for compress_pdf).
noteNoAnything the user should know about the result.
textNoExtracted text (pdf_to_text, ocr_pdf).
filesYesResult files. Download them before expires_at; pass file_id to another tool to chain.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and idempotentHint=true, so the safety profile is covered. The description adds that a brand-new PDF is produced (implying the input file is untouched) and that page order is preserved, but says nothing about how the source file or extracted page content (annotations, links) is handled.

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?

A single front-loaded sentence with the verb first and a concrete inline example; no filler or redundancy.

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 simple two-parameter tool with full schema coverage and an output schema, the description covers the essential behavior. The only missing nuance is confirmation that the original PDF is unchanged and how the result is delivered (e.g. a new file_id), which is partly implied by the output schema.

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% and the schema already documents both file sources and the pages grammar including ranges and 'end'. The description's '5, 1, 2 starts with page 5' example adds a marginal note that ordering is honored rather than sorted, but otherwise restates the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb and resource ('Create a new PDF containing only the selected pages') and adds a scope detail on ordering. It does not explicitly distinguish itself from close siblings such as delete_pages or split_pdf, so it falls short of a 5.

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

Usage Guidelines3/5

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

Usage is only implied: the phrase 'containing only the selected pages' suggests a keep-subset operation, but there is no statement of when to prefer this over delete_pages (remove unwanted pages) or split_pdf (divide into multiple files).

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.

Resources