Skip to main content
Glama

run_pjsr_file

Execute a PJSR JavaScript file from disk inside PixInsight and return its console output. Supports background jobs with progress and cancellation.

Instructions

Run a PJSR (JavaScript, V8 engine) source file from disk inside PixInsight and return its console output. Same execution model as run_pjsr, with the code read from a file instead of passed inline. No ES6 module syntax; the file content is eval-ed, so #include does not work. Code that does not parse is refused with its line number before anything reaches PixInsight.

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path to the PJSR source file.
asyncNoRun as a job: the call returns a job id at once and the code runs in PixInsight in the background. job_status reports on the job and returns its result; cancel_job stops it. While a job runs, other calls that use PixInsight are refused. The running code can call mcpProgress(text) to report progress and mcpCancelRequested() to see whether cancel_job was called.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.1
    • addedInput schema / properties / async
      Added value: +{
      +  "description": "Run as a job: the call returns a job id at once and the code runs in PixInsight in the background. job_status reports on the job and returns its result; cancel_job stops it. While a job runs, other calls that use PixInsight are refused. The running code can call mcpProgress(text) to report progress and mcpCancelRequested() to see whether cancel_job was called.",
      +  "type": "boolean"
      +}
  2. First observedv2.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that content is eval-ed, no ES6 module syntax, #include does not work, and parse failures are refused with a line number before reaching PixInsight. The async behavior (job id, background execution, blocking other PixInsight calls, mcpProgress/mcpCancelRequested) is described, though much of it is duplicated in the schema's async property.

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?

Four sentences, front-loaded with purpose and the sibling comparison, then the two key execution constraints. Every sentence carries information, though the async description slightly overlaps the schema text.

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?

No output schema exists, and the description does state the return ('console output'), plus parse-error behavior and the async result path via job_status. Combined with 100% schema coverage, an agent has what it needs to call this correctly; only minor details (e.g., output formatting/truncation) are unaddressed.

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?

Schema description coverage is 100%, so both parameters are already fully documented by the schema itself, including the async job semantics. The description adds execution-model context but no additional per-parameter meaning, so the baseline of 3 applies.

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?

States a specific verb (run) and resource (a PJSR JavaScript source file from disk), and clarifies the return ('return its console output'). It explicitly distinguishes itself from the closest sibling by noting it is 'Same execution model as run_pjsr, with the code read from a file instead of passed inline.'

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 inline-vs-file contrast with run_pjsr gives clear routing guidance, and the async paragraph explains the job model and the sibling tools job_status/cancel_job. It lacks an explicit exclusion (e.g., 'use run_pjsr instead when the code is not on disk'), so it is strong but not fully exhaustive.

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