Skip to main content
Glama

validate_postscript

Validates PostScript and EPS programs by interpreting them with Ghostscript's bbox device, reporting syntax errors, undefined names, stack issues, and computing bounding boxes.

Instructions

Interpret a PostScript/EPS program WITHOUT rasterising and report errors.

This is the fast self-check to run before presenting any PostScript. It uses Ghostscript's bbox device, so it catches real interpreter errors (undefined names, stack underflow, type errors, unbalanced save/restore) and returns the computed bounding box — useful for setting an EPS %%BoundingBox.

Provide EITHER source (the program text) or path (a file on disk).

Returns: {ok, diagnostics[{error, offending_command, message, is_postscript_error}], bbox, hires_bbox, hint, ghostscript_stderr}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
sourceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden and largely delivers: it discloses the mechanism (Ghostscript's bbox device), enumerates the specific errors caught (undefined names, stack underflow, type errors, unbalanced save/restore), and details the return structure including ok, diagnostics, bbox, hires_bbox, hint, and ghostscript_stderr. This is transparent for a validation tool whose read-only nature is implied by 'WITHOUT rasterising.'

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?

The description is well-structured into focused paragraphs: core purpose first, then usage context, then parameter guidance, then return format. Every sentence earns its place, and the return-format line is justified given the absence of an output schema. Slightly long but appropriately front-loaded with the most critical scoping information.

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?

For a 2-parameter tool with no annotations and no output schema, the description is remarkably complete: it explains the return format (essential since no output schema exists), the parameter semantics, the underlying mechanism, and the error categories detected. Minor omissions include handling when both or neither parameter is provided, but nothing an agent needs to invoke it correctly is missing.

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 description coverage is 0%, so the description must compensate, and it does meaningfully: 'Provide EITHER source (the program text) or path (a file on disk)' explains what each parameter holds and, critically, the exclusive either/or relationship between them. This adds substantial value beyond the bare schema titles, though it stops short of detailing formats or error behavior when neither is supplied.

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 opening line, 'Interpret a PostScript/EPS program WITHOUT rasterising and report errors,' uses a specific verb (interpret/validate), a clear resource (PostScript/EPS), and a differentiating qualifier (WITHOUT rasterising) that separates it from the sibling render_postscript. The purpose is unmistakable and immediately distinguishes this validation tool from its rendering counterpart.

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?

The description clearly states when to use it: 'This is the fast self-check to run before presenting any PostScript.' It also frames the alternative implicitly through 'WITHOUT rasterising,' implying render_postscript is the choice when rasterized output is needed. However, it never names alternatives explicitly or states when NOT to use it, leaving a small gap in exclusion guidance.

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