Skip to main content
Glama

TeX402 JSON Invoice to PDF ($0.010 USDC)

tex402_invoice

Render a print-ready business or Web3 Invoice/Receipt PDF from structured JSON with deterministic BigInt fixed-point totals, optional logo, and offline vector payment QR code across 4 LaTeX themes (clean, ledger, minimal, web3) via POST /v1/pdf/invoice ($0.010 USDC via x402). Returns computed_totals, a 15-minute PDF download_url, and optional 150-DPI PNG page preview image blocks.

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": {
      "invoice_number": "<invoice_number>",
      "from": "<from>",
      "to": "<to>",
      "line_items": "<line_items>"
    },
    "name": "tex402_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesBuyer or recipient party details
fromYesSeller or issuer party details
itemsNoOptional alias for line_items
notesNo
termsNo
themeNoVisual LaTeX theme for the generated invoice PDFclean
statusNounpaid
currencyNoISO 4217 currency or token ticker such as USD, EUR, JPY, or USDCUSD
due_dateNo
po_numberNo
tax_labelNo
issue_dateNo
line_itemsYes
paper_sizeNoletter
amount_paidNo
logo_base64NoOptional PNG or JPEG company logo encoded as base64 or base64:... (at most 1 MB decoded)
accent_colorNoOptional 6-digit hex accent color such as #0f172a
invoice_numberYesUnique invoice identifier such as INV-2026-0042
currency_symbolNoOptional explicit currency symbol override
discount_amountNo
shipping_amountNo
discount_percentNo
tax_rate_percentNo
payment_instructionsNo
include_page_previewsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changed
    • changedInput schema / properties / amount_paid / oneOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "pattern": "^\\d+(\\.\\d{1,6})?$",
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / currency / pattern
      Added value: +"^[A-Za-z0-9]{2,12}$"
    • changedInput schema / properties / discount_amount / oneOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "pattern": "^\\d+(\\.\\d{1,6})?$",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / discount_percent / oneOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 100,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "pattern": "^\\d+(\\.\\d{1,6})?$",
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / from / properties / name / minLength
      Added value: +1
    • addedInput schema / properties / invoice_number / minLength
      Added value: +1
    • addedInput schema / properties / items
      Added value: +{
      +  "description": "Optional alias for line_items",
      +  "items": {
      +    "properties": {
      +      "description": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "quantity": {
      +        "oneOf": [
      +          {
      +            "default": 1,
      +            "minimum": 0.000001,
      +            "type": "number"
      +          },
      +          {
      +            "pattern": "^\\d+(\\.\\d{1,6})?$",
      +            "type": "string"
      +          }
      +        ]
      +      },
      +      "unit_price": {
      +        "oneOf": [
      +          {
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          {
      +            "pattern": "^\\d+(\\.\\d{1,6})?$",
      +            "type": "string"
      +          }
      +        ]
      +      }
      +    },
      +    "required": [
      +      "description",
      +      "unit_price"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 200,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / line_items / items / properties / description / minLength
      Added value: +1
    • changedInput schema / properties / line_items / items / properties / quantity / oneOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "default": 1,
      +    "minimum": 0.000001,
      +    "type": "number"
      +  },
      +  {
      +    "pattern": "^\\d+(\\.\\d{1,6})?$",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / line_items / items / properties / unit_price / oneOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "pattern": "^\\d+(\\.\\d{1,6})?$",
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / payment_instructions / properties / payment_url / maxLength
      Added value: +256
    • addedInput schema / properties / payment_instructions / properties / payment_url / pattern
      Added value: +"^https?://\\S+$"
    • addedInput schema / properties / payment_instructions / properties / qr_data / maxLength
      Added value: +256
    • changedInput schema / properties / shipping_amount / oneOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "pattern": "^\\d+(\\.\\d{1,6})?$",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / tax_rate_percent / oneOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 100,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "pattern": "^\\d+(\\.\\d{1,6})?$",
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / to / properties / name / minLength
      Added value: +1
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the annotations (openWorldHint, non-idempotent, non-destructive), the description discloses concrete behavior: a paid call ($0.010 USDC via x402), deterministic 10^6-scaled BigInt math, a returned computed_totals object, and a 15-minute expiring download_url. It stops short of covering error modes or rate/retry behavior for a metered endpoint.

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 front-loaded sentences that carry a lot of high-value detail (artifact, endpoint, cost, returns) with little filler. It is dense but each clause earns its place; minor tightening of the theme enumeration would help.

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

Completeness3/5

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

For a 25-parameter nested-schema tool with no output schema, the description usefully describes return values (computed_totals, download_url, PNG previews) and cost. But it leaves the majority of input parameters and their interrelations undocumented, which is a notable gap for a schema this large.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 36% across 25 parameters, many of which (status, paper_size, accent_color, discount/tax/shipping fields, notes, terms) are undocumented in the schema. The description compensates only partially, covering themes, logo, QR, and the fixed-point math, leaving most field semantics unexplained.

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 leads with a specific verb and artifact ('Render a print-ready business or Web3 Invoice/Receipt PDF from structured JSON'), names the transport endpoint, the price, and the four themes. This clearly separates it from the sibling tools (compile, lint, resume, status, themes), which handle different resources.

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?

It establishes clear context: use when you have a structured invoice payload and need a PDF/PNG artifact, including the Web3/payment-QR case. However, it never explicitly states when NOT to use it or names a sibling alternative, so routing is inferred rather than directed.

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