Skip to main content
Glama

TeX402 LaTeX to PDF Compiler ($0.008 USDC)

tex402_compile

Compile multi-file LaTeX (.tex) source to PDF inside TeX402's networkless Docker TeX Live sandbox via POST /v1/compile ($0.008 USDC via x402). Returns a 15-minute PDF download_url, structured diagnostics, 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": {
      "main_tex": "<main_tex>"
    },
    "name": "tex402_compile"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNoOptional map of safe relative project paths (e.g. 'refs.bib', 'styles/custom.sty', 'images/fig1.png') to UTF-8 text or 'base64:...' binary payloads
engineNoTeX engine used for compilation ('pdflatex' or 'xelatex')pdflatex
main_texYesRoot LaTeX document source code (.tex)
bibliographyNoRun multi-pass biber/bibtex bibliography resolution when true
include_page_previewsNoRender 150-DPI PNG page previews and return them as native MCP image/png blocks

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false, idempotentHint=false, openWorldHint=true, destructiveHint=false; the description adds genuinely non-obvious behavior on top of that — payment is required via x402 at a stated price, the sandbox is networkless, the returned download_url expires after 15 minutes, and diagnostics come back structured. Gaps remain around failure behavior, compile timeouts, and input size limits, so it is strong but not exhaustive.

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?

Two sentences, zero filler, and every clause carries load: capability, environment, endpoint, price, then return artifacts with expiry. The front-loaded verb-and-resource opening means an agent can decide on the tool from the first clause alone.

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?

With no output schema and a nested files map, the description compensates by naming the return artifacts (expiring download_url, structured diagnostics, optional PNG blocks) and the payment model. It stops short of covering error/failure modes or sandbox limits, which matters for a compute-and-pay tool with a non-idempotent annotation.

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%, so the schema already explains engine, files, bibliography, and main_tex; the description's only parameter-level addition is that previews come back as native MCP image/png blocks at 150 DPI, which usefully signals the return shape of include_page_previews. It adds nothing about the base64:... binary convention or multi-pass bibliography cost, so baseline 3 is warranted.

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?

The description gives a specific verb+resource+output: compile multi-file LaTeX .tex source to PDF, and names the concrete execution environment (TeX402's networkless Docker TeX Live sandbox) and endpoint (POST /v1/compile). It does not explicitly contrast itself with siblings such as tex402_lint or tex402_themes, though 'compile ... to PDF' is functionally distinct enough that an agent can separate it from a linter without opening the schemas.

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: use this when you have LaTeX source you want rendered to PDF. There is no explicit when-to-use/when-not statement, no mention of a lint-first workflow despite tex402_lint existing, and no guidance on when to enable bibliography or page previews. The stated price ($0.008 USDC) does help an agent weigh whether to invoke it, but no alternatives are routed.

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