Skip to main content
Glama

run_pjsr

Execute a PJSR JavaScript snippet in PixInsight to perform custom operations and return console output. Covers tasks other tools don't support, with optional file includes.

Instructions

Run a PJSR (JavaScript, V8 engine) snippet inside PixInsight and return its console output. Last resort for things the other tools do not cover. Call processEvents() before each long process (BXT, NXT, SXT) so Pause/Abort works. No ES6 module syntax; the snippet is eval-ed as a script, so #include does not work and a top-level return is a syntax error; include prepends files instead. Code that does not parse is refused with its line number before anything reaches PixInsight.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPJSR code. The value of the last expression is returned.
includeNoAbsolute paths of PJSR source files whose contents run before `code`, in this order, in the same scope, so functions they define can be called from `code`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden, and it is highly transparent: it reveals eval semantics, no ES6 module syntax, #include failure, top-level return being a syntax error, include prepending behavior, and parse refusal with line numbers before execution reaches PixInsight.

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?

The description is dense but every sentence earns its place: purpose and fallback positioning, a practical processEvents tip, then the critical syntax and parsing limitations. It is front-loaded with the most important selection information and wastes no words.

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

Completeness5/5

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

For a powerful code-execution tool with no annotations and no output schema, this description covers what the tool returns, how includes work, syntax restrictions, parse-error behavior, and a usage safeguard. An agent has enough to decide when to use it and how to avoid common failures.

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 100%, so the baseline is 3. The description adds meaningful code-parameter constraints beyond the schema: snippets are eval-ed as scripts, top-level return is invalid, #include does not work, and non-parsing code is refused with a line number. These are important operational details not present in the schema.

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 uses a specific verb and resource: 'Run a PJSR (JavaScript, V8 engine) snippet inside PixInsight and return its console output.' It also positions the tool as a 'last resort for things the other tools do not cover,' which clearly distinguishes it from the many sibling tools.

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 explicitly says to use this tool only as a last resort when other tools do not cover the need, and it gives a concrete procedural instruction to call processEvents() before long processes. It does not name specific alternative tools, but the 'last resort' framing provides clear selection context.

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