Skip to main content
Glama

run_pjsr

Execute custom PJSR JavaScript snippets inside PixInsight to perform operations not covered by standard tools, returning console output for results.

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, so #include does not work.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPJSR code. The value of the last expression is returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It discloses that the snippet is eval-ed, that ES6 module syntax will not work, that #include is unsupported, and that console output is returned. These are exactly the hidden traits an agent needs to know before invoking an arbitrary-code tool.

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 sentences with no fluff. The core action comes first, followed by usage guidance and critical syntax limitations. Every sentence earns its place and the structure front-loads the most decision-relevant information.

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 single-parameter tool with no output schema, the description is complete: it explains what the tool does, when to use it, what to expect as output, how to keep long processes responsive, and what syntax limitations exist. Nothing essential is missing.

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?

The schema covers 100% of the parameter documentation, including the important detail that the value of the last expression is returned. The description reinforces this by mentioning console output but does not add substantial new meaning beyond what the schema already provides. Baseline 3 is appropriate.

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: 'Run a PJSR snippet inside PixInsight and return its console output.' It also differentiates itself by declaring it a 'last resort' tool relative to other tools, which clearly separates it from siblings like run_process or run_pjsr_file.

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 explicitly tells the agent when to use the tool: as a last resort for things other tools do not cover. It also provides a concrete operational guideline about calling processEvents() before long processes. It does not name specific sibling alternatives, but the exclusion is clear enough.

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