Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PSMCP_DATA_DIRNoLocation of operators.json and pslib_index.json../data
PSMCP_CORPUS_DIRNoLocation of the search corpus../corpus
PSMCP_OUTPUT_DIRNoWhere rendered files are written.temp dir
PSMCP_GHOSTSCRIPTNoPath to the gs binary.auto-detected
PSMCP_LIBRARY_DIRNoWhere your reference PDFs / PSlib sources live (for ingest)../library
PSMCP_RENDER_TIMEOUTNoGhostscript wall-clock limit (seconds).30
PSMCP_MAX_SOURCE_BYTESNoMax program size accepted.4194304

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
validate_postscriptA

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}.

render_postscriptA

Render a PostScript/EPS program to a PDF, PNG or SVG file.

output_format is one of: "png", "png-alpha", "pdf", "svg". resolution is DPI for raster output. page (1-based) renders a single page. eps_crop trims to the bounding box (good for EPS figures). Set return_base64 to also receive PNG bytes inline for quick preview.

Provide EITHER source or path. The output file path is returned so a human can open it. Diagnostics are reported the same way as validate_postscript — always check ok and fix any diagnostics.

lookup_operatorA

Return the exact PLRM definition of a PostScript operator.

Gives the stack signature (operands operator results), a summary, the LanguageLevel it requires, and the errors it can raise. Use this to get operand order and types right instead of guessing.

Example: lookup_operator("arc") → signature "x y r ang1 ang2 arc -", category "path", level 1.

search_operatorsA

Search PostScript operators by keyword or browse a category.

Pass a query (e.g. "rotate", "fill path", "cmyk") to rank operators by relevance, or a category to list it. Categories include: stack, math, array, dict, string, boolean, control, type, file, vm, gstate, color, matrix, path, paint, text, font, device, resource, misc.

get_pslib_fragmentA

Return a PSlib procedure by name, with its stack signature and source.

PSlib is Kees van der Laan's library (colours, geometry such as circle inversion and Apollonius, Lauwerier fractals, Blue-Book text/graphics helpers). Reuse these vetted procedures instead of reinventing them. The source is ready to paste; include the whole library at run time with e.g. (PSlib.eps) run.

search_pslibA

Search or browse PSlib procedures.

Pass a query (e.g. "dragon", "circle inversion", "cmyk colour") or a category (color, fractal, geometry, text, complex, linalg, arrow, units, util, misc). Returns names with one-line signatures; call get_pslib_fragment to retrieve full source.

search_referenceA

Search the PostScript reference corpus and return cited passages.

Covers whatever was ingested: the PLRM, the Blue and Green books, the DSC and EPS specifications, and the tutorials. Optionally restrict to one document with doc (substring of its name, e.g. "PLRM", "Green", "DSC"). Each hit includes the document, page/block number and a snippet so you can cite the spec precisely.

postscript_capabilitiesA

Report what this server can currently do (for setup/debugging).

Tells you whether Ghostscript is available for rendering, how many operators are loaded, whether the PSlib index and reference corpus have been built, and how to build them if not.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.3/5.0

Scored across 8 tools

Disambiguation5/5

Each tool targets a distinct job: exact operator definitions vs operator search, validation vs rendering, PSlib retrieval vs searching, and reference/capability lookups. Even the paired search/get tools are clearly separated by role.

Naming Consistency4/5

Most tools follow a consistent verb_noun pattern (lookup_operator, validate_postscript, search_operators). The only deviation is postscript_capabilities, which lacks a verb; otherwise the naming is uniform and predictable.

Tool Count5/5

Eight tools is an appropriate size for a PostScript assistant: each one covers a necessary stage of authoring, checking, rendering, and reference lookup without redundancy. The count feels intentional rather than padded.

Completeness5/5

The surface covers a full workflow: discover operators, validate code, render output, reuse library procedures, and consult authoritative references. There are no dead ends or obvious missing operations for the stated domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues