Skip to main content
Glama

Subpay Document Reader

Read an AIA G702/G703 pay application or a change order

extract_document

Reads construction pay applications — the AIA G702 Application and Certificate for Payment with its G703 Continuation Sheet, including Procore and Textura versions — and change orders, from PDF into structured JSON with arithmetic checks. Returns gross this period, retainage held and released, completed to date, contract sum, balance to finish and payment due for pay apps; for change orders, whether it is the subcontractor's request or the GC's executed change order, plus number, amount and date. $0.04 per page (up to 25 pages) in USDC per successful read via x402, quoted before you pay; failed reads are free. First 3 reads a day are free (documents up to 10 pages, no payment needed); after that, the usual price.

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": {
      "document": "<document>"
    },
    "name": "extract_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
gcNoGeneral contractor name.
documentYesThe PDF, base64-encoded (a data: URL prefix is fine). Max about 3 MB and 25 pages.
fileNameNoOriginal file name, if known.
subcontractorNoSubcontractor company name — helps tell an RCO from a GC change order.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / document / description
      Previous value: -"The PDF, base64-encoded (a data: URL prefix is fine). Max about 3 MB."New value: +"The PDF, base64-encoded (a data: URL prefix is fine). Max about 3 MB and 25 pages."
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden and does so well: it reveals the x402/USDC payment mechanism, per-page price, that a quote precedes payment, that failed reads are free, and the free-tier quota. It does not say what happens when the arithmetic checks fail (error vs. flagged output) or how failures are surfaced, which is the main remaining behavioral gap.

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?

Well front-loaded: purpose and document scope first, then the returned fields, then pricing and limits. It is dense — the pricing/free-tier sentence packs several clauses — but every sentence carries decision-relevant information and none is filler.

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?

Since there is no output schema, the description correctly enumerates the returned values (gross this period, retainage held/released, completed to date, contract sum, balance to finish, payment due; change order type, number, amount, date), and it covers cost, quota, and input limits. Slightly incomplete on failure/edge-case behavior, but sufficient for an agent to call it correctly.

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 coverage is 100%, so all four parameters are already documented in structured data, including the subcontractor hint for disambiguating RCO vs. GC change order. The description adds no parameter-level meaning beyond the schema — it only references the document size/page limits that the schema already states — so the baseline 3 applies.

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?

Names a specific verb ("Reads") and precise resources (AIA G702 Application with G703 Continuation Sheet, Procore and Textura variants, change orders) plus the transformation (PDF into structured JSON with arithmetic checks). An agent knows exactly what document types this handles and what it returns without opening the schema.

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?

Clearly establishes the trigger context (construction pay applications and change orders in PDF form) and gives decision-relevant cost/limit conditions — 25-page cap, ~3 MB, free tier of 3 reads/day up to 10 pages. It stops short of stating when NOT to use it or naming an alternative path for unsupported documents.

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