Skip to main content
Glama

Compile project

typst_compile
Idempotent

Compile a Typst project with the local CLI to check builds after edits, returning file-and-line errors or warnings, output paths, and optional inline PNG page previews.

Instructions

Compile a project with the local typst CLI and return errors/warnings with file and line, plus the output path. Use it after edits to check the document builds. format 'png' with preview_pages>0 returns page images inline so you can look at the layout. Packages (@preview/...) are downloaded automatically.

Input Schema

NameRequiredDescriptionDefault
ppiNopng resolution
formatNopdf
main_fileNoEntry file; defaults to the project's main file
project_idYesProject ID from typst_list_projects, e.g. 'pAbC123dEf456gHi789jKl'
output_pathNoLocal output path; for png/svg '{p}' is replaced by the page number
preview_pagesNopng only: return the first N pages as images

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare idempotency, non-destructiveness, and open-world behavior. The description adds useful behavioral context: compile errors and warnings include file and line information, the output path is returned, preview images are returned inline, and @preview packages are downloaded automatically. It does not detail failure modes or blocking behavior, but the added context is meaningful.

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?

Three focused sentences, front-loaded with the core action and return shape, followed by the usage cue and the preview behavior. Every sentence adds information without repetition.

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, the description does a good job explaining what the tool returns: errors/warnings with location, an output path, and optional inline images. It also covers automatic package downloading. A fully complete description might mention how fatal compile failures are reported, but the essentials are present.

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

Parameters4/5

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

Schema coverage is 83%, so the baseline is 3. The description adds value by explaining the key interaction that 'png' plus preview_pages>0 returns inline page images, which is not obvious from the schema alone, though it does not add detail for ppi, main_file, or output_path beyond what the schema provides.

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 states a specific verb and resource ('Compile a project with the local typst CLI') and clearly distinguishes this tool from all sibling tools, none of which perform compilation. It also specifies the primary outputs: errors/warnings with file and line, the output path, and optional inline page images.

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 gives explicit guidance to use the tool after edits to check that the document builds, and it explains that format 'png' with preview_pages>0 is the way to inspect layout visually. No alternative tools are named, but there is no sibling compiler to route to, so the context is sufficient.

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