Skip to main content
Glama

fiji_module_run_script

Run Groovy script text directly in Fiji without writing a file, passing named inputs and returning results or a job id. Declare parameters and outputs with #@ lines for atlas workflows.

Instructions

Run a script given as text (Groovy by default) as fiji_module_run runs a script file: same inputs, result, job id and status, nothing written to disk. For what no command does: search the commands first. Declare what it needs with #@ lines, e.g. '#@ ImagePlus image' (an object input with one live instance is bound to it) or '#@ CommandService command', and what it returns with '#@output String result'. Recorded in fiji_module_script with its code; '#@script(record="false")' leaves out a script that only looks. Write Groovy, as ABBA's docs and examples: 'python' here is Jython 2.7, not CPython. Read scripting/groovy-steps.md before the first script: a line starting with #@ is a parameter even inside a string. The ABBA window is a ch.epfl.biop.atlas.aligner.gui.bdv.BdvMultislicePositionerView, the session a ch.epfl.biop.atlas.aligner.MultiSlicePositioner (guides/window.md, scripting/).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesthe script, with its #@ parameters
inputsNoJSON object of input values by name, as for fiji_module_run
languageNogroovy (default, recommended), or another language name or file extension; 'python' is Jython 2.7, not CPython: no numpy, no pip packages
wait_secondsNoseconds to wait for the result before returning the job id (default 30, at most 40: clients abort requests after about 60 s; follow a longer run with fiji_module_status)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and openWorldHint=false; the description adds meaningful behavior beyond that - the run is recorded in fiji_module_script with its code, '#@script(record="false")' opts out for observation-only scripts, nothing is written to disk, and 'python' is Jython 2.7 not CPython. These are real traits an agent would not learn from the structured fields. Remaining gap: no explicit statement of what state a script may mutate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The first sentence is well front-loaded, but the paragraph is dense and runs on with implementation trivia (BdvMultislicePositionerView, MultiSlicePositioner class paths, doc paths) that competes with the core instruction. Information-rich but not tight; several clauses could be trimmed or moved to a doc reference.

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 mutation tool with no output schema, the description covers async behavior (follow a longer run with fiji_module_status), the wait_seconds constraint rationale, language caveats, and input/output declaration conventions. What an agent needs to invoke it correctly is present, though the specifics of return payload rely on the sibling fiji_module_run.

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, but the description adds genuine semantics: inputs are declared in-script with '#@' lines, an object input with one live instance is bound to it, and outputs are declared with '#@output'. This goes beyond the schema's terse per-parameter strings.

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 and resource ('Run a script given as text') and immediately anchors it to a sibling ('as fiji_module_run runs a script file'), so the agent can distinguish text-execution from file-execution without opening either schema. The scope ('same inputs, result, job id and status, nothing written to disk') sharpens the boundary further.

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?

Gives explicit routing guidance: 'For what no command does: search the commands first,' sending the agent to fiji_module_search when a built-in command exists, and advises reading scripting/groovy-steps.md before the first script. It lacks a negative-case statement about when this tool is the wrong choice, but the alternative and prerequisites are clear.

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