Skip to main content
Glama

flow-add-script

Run a local .mjs file and record it as a script step in an active flow. Use when a local script is requested, passing the same flow name and project root.

Instructions

Run a local .mjs file and record it as a script: step in an active flow. Use this tool only when the user requests a local script in the flow. Pass the same name and project_root as flow-start-recording, and call it where the script must run. A failed script is not recorded. Check reason and the affected state before you retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesFlow name passed to flow-start-recording.
pathYesPath to the .mjs file, relative to the flow YAML. For example: "../../scripts/seed-order.mjs".
timeoutNoOptional time limit in milliseconds. The default is 30000 and the minimum is 100.
project_rootYesAbsolute project root passed to flow-start-recording.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.25.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure. It adds valuable context: failed scripts are not recorded, and the agent should check `reason` and affected state before retrying. This goes beyond the basic operation and warns about failure semantics.

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?

Four sentences, each earning its place: purpose, usage condition, invocation guidance, and failure/retry behavior. The most important scoping and safety details are front-loaded without redundancy.

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?

Given no output schema and no annotations, the description covers the essential context: input, placement, relationship to recording state, and failure behavior. It does not detail return values beyond the `reason` hint, but that is a minor gap for this tool.

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 the schema already documents all parameters. The description mainly repeats that `name` and `project_root` must match `flow-start-recording`, which is already stated in their schemas. No meaningful new parameter semantics are added.

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 clearly states the action: run a local .mjs file and record it as a `script:` step in an active flow. It distinguishes this from siblings like flow-add-step and flow-add-echo by naming the specific step type and file source.

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 scopes usage to when the user requests a local script in the flow, and it gives the critical consistency requirement of matching `name` and `project_root` from `flow-start-recording`. It does not name an alternative tool, 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.