Skip to main content
Glama

e2e-add-script

Runs a local JavaScript or TypeScript file and records it as a script step in an active e2e test at the chosen recording point. Use it when a test needs to execute local script logic.

Instructions

Run a local JavaScript (.mjs, .js) or TypeScript (.mts, .ts) file and record it as a script: step in an active e2e test. Use when the user requests a local script in the e2e test, and only then. Call it at the point in the recording where the script must run. Returns status, reason and stepCount. A failed script is not recorded. Check reason and the affected state before you retry. Over a link (argent link or ARGENT_TOOLS_URL), the tool refuses the call: record such an e2e test with no link.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "project_root": "<project_root>",
      "path": "<path>"
    },
    "name": "e2e-add-script"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesE2E test name passed to e2e-start-recording.
pathYesPath to the script file (.mjs, .mts, .js or .ts), relative to the e2e test YAML. For example: "../../scripts/seed-order.mjs".
timeoutNoTime limit in milliseconds. The default is 30000 and the minimum is 100.
project_rootYesAbsolute project root passed to e2e-start-recording.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden and does well: it discloses the return fields (status, reason, stepCount), that failed scripts are not recorded, that the caller should inspect reason and state before retry, and that the tool refuses calls over argent link / ARGENT_TOOLS_URL. It leaves unclear where/with what privileges the file actually executes and whether a recorded step is later removable, which keeps it below a 5.

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?

Six short sentences, front-loaded with the action and its effect, then conditions, return contract, failure handling, and the link restriction. Each sentence contributes a distinct operational fact with no filler.

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?

There is no output schema, so inline statements about status/reason/stepCount and the non-recording of failed scripts fill that gap. With annotations absent, the refusal behavior and preconditions (active e2e test, reference to e2e-start-recording arguments) are all supplied, leaving nothing essential an agent needs before calling.

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 all four parameters (name, path, timeout, project_root) are already documented, including path relativity and timeout defaults. The description only re-states that the file is local and extension-restricted, adding nothing about parameter formats beyond the schema; baseline 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 and resource ("Run a local JavaScript (.mjs, .js) or TypeScript (.mts, .ts) file") plus the resulting effect ("record it as a `script:` step in an active e2e test"). The step-type framing (script: step) plus accepted file extensions makes it distinguishable from siblings such as e2e-add-echo or e2e-add-step without opening a schema.

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 when-to-use ("when the user requests a local script in the e2e test, and only then") and placement guidance ("Call it at the point in the recording where the script must run"), plus the condition under which the call is refused over a link. It does not name a sibling alternative for recording non-script steps, so it stops short of full when/when-not/alternative coverage.

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