Skip to main content
Glama

extract_pages

Extract selected pages from a loaded PDF into a new PDF file while preserving their takeoff shapes and annotations, useful for splitting plans into smaller, focused drawing sets.

Instructions

Extract a subset of pages from a loaded PDF into a new PDF file on disk. Carries all takeoff shapes and annotations on those pages into the new document (mapped to pages 1..N). Coordinates are image px at render scale 2.0: PDF pt × 2, origin top-left, y down (the browser canvas's native space). Sheet payloads carry dims in both px and pt.

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 loaded PDF file name
pagesYes1-based page numbers to extract, e.g. [2, 3]
overwriteNoReplace the file at path even when it is not an OpenTakeoff export. Off by default: re-exporting over a previous export of your own already overwrites without this, so you only need it to deliberately destroy an unrelated file.
output_pathNoDestination file path (default: "<file>_extracted.pdf")

Output Schema

NameRequiredDescriptionDefault
noteYes
page_countYes
output_fileYes
source_fileYes
takeoff_fileNo
shapes_carriedYes
extracted_pagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.32

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose meaningful behavior: takeoff shapes and annotations on the selected pages are carried over and remapped to pages 1..N, and the coordinate convention (px at scale 2.0, origin top-left, y down) is spelled out. What is missing is any note on destructive overwrite risk or limits, though the overwrite behavior is documented in the schema rather than contradicted here.

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?

Three dense sentences, front-loaded with the core action and outcome, with no filler. The trailing coordinate-space and 'dims in both px and pt' sentences are contextually relevant but sit slightly apart from the extraction action itself.

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?

An output schema exists, so return values needn't be explained, and the description covers the key behavioral wrinkle (shapes/annotations carried and remapped). Given a read-then-write export tool with full schema coverage, this is nearly complete; only explicit overwrite-risk framing in the prose is absent.

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%, including the non-obvious overwrite semantics and the default output_path, so the schema already does the heavy lifting. The description adds no parameter-level meaning beyond coordinate-space context, which is output-oriented rather than clarifying the four inputs.

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?

States a specific verb ('extract') and resource ('a subset of pages from a loaded PDF') plus the concrete outcome ('into a new PDF file on disk'), which is clearly distinct from siblings such as reorder_pages or export_marked_pdf. It never names a sibling or explicitly contrasts itself with other page/export tools, so it stops short of full differentiation.

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?

The intent (pull a subset of pages into a standalone PDF) implies when to reach for this tool, and 'loaded PDF' hints at a prerequisite. But there is no explicit when-to-use/when-not guidance and no mention of alternatives like reorder_pages or export_marked_pdf for overlapping page/export needs.

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