Skip to main content
Glama

reorder_pages

Reorder PDF pages and remap takeoff sheet keys so measurements and annotations follow their pages, keeping takeoff data aligned after page order changes.

Instructions

Reorder pages in a loaded PDF document. Remaps all takeoff sheet keys so measurements and annotations follow their pages. Output file path is optional (default: "_reordered.pdf"); pass overwrite:true to allow replacing an existing file. 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>",
      "order": "<order>"
    },
    "name": "reorder_pages"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe loaded PDF file name (e.g. "plan.pdf")
orderYes1-based new page order, e.g. [2, 1, 3] to swap pages 1 and 2
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>_reordered.pdf")

Output Schema

NameRequiredDescriptionDefault
fileYes
noteYes
orderYes
sheetsYes
output_fileNo
shapes_remappedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.32

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does well: it discloses the non-obvious side effect that sheet-key remapping keeps measurements and annotations attached to their pages, the default output path, and the destructive semantics of overwrite ("deliberately destroy an unrelated file"). It does not say whether the source file is left untouched or what happens if order is not a full permutation.

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?

Purpose and side effects are front-loaded, then defaults and overwrite semantics, then coordinate conventions. Every sentence is relevant, though the coordinate/px-vs-pt sentence is dense and somewhat tangential to a reorder operation, making the paragraph slightly heavy.

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 need no explanation, and the description covers side effects, defaults, and the destructive escape hatch. The main residual gap is whether order must be a complete permutation matching the page count or whether partial lists are accepted.

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 file, order, overwrite, and output_path in detail, including the default. The description largely restates the default path and overwrite behavior; the coordinate-space sentence adds real meaning but does not describe a parameter, so it does not lift this above the baseline.

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 and resource: "Reorder pages in a loaded PDF document," and adds the key consequence that takeoff sheet keys are remapped so measurements follow pages. It is unambiguous about what it does, though it never names a sibling (e.g., extract_pages) to sharpen the boundary.

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?

"in a loaded PDF document" establishes the prerequisite that the file must already be loaded, and the description explains default output naming plus exactly when overwrite:true is needed versus when re-exporting already overwrites. It gives no explicit when-not guidance or comparison to alternative page-manipulation tools.

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