Skip to main content
Glama

run_with_scripts

Send a stored request after running its pre-request script to set variables, then run a post-response script to extract values. Use it to reproduce Insomnia's scripting behavior when testing APIs.

Instructions

Send a stored request, running its pre-request script first (to mutate variables) and post-response script after (to extract values). Mirrors Insomnia's scripting behaviour.

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": {
      "request_id": "<request_id>"
    },
    "name": "run_with_scripts"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmedNoSet to true to confirm sending to an external URL after reviewing it
pre_scriptNoOverride or provide a pre-request script
request_idYes
post_scriptNoOverride or provide a post-response script
environment_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.6-beta

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses script execution order and effects (mutating variables before, extracting values after), but omits external-send/confirmation behavior, script side effects, and safety context.

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?

The description is two sentences, front-loaded with the core action and script sequence. Every part contributes useful context, with only a brief Insomnia reference as supporting detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and five parameters, the description covers the core request/script flow but leaves confirmation, environment behavior, and result handling unaddressed. It is adequate but not fully complete.

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 coverage is 60%, with descriptions for confirmed, pre_script, and post_script. The description adds meaning about what pre/post scripts do, but it does not clarify the override semantics of pre_script/post_script, nor does it explain request_id or environment_id.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description specifies the verb (Send), the resource (a stored request), and a key differentiator: running pre-request and post-response scripts. It is clear, but it does not explicitly distinguish itself from sibling runners such as run_data_driven or run_request_chain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool should be used when a stored request needs pre/post scripts, but it gives no explicit when-to-use, when-not-to-use, or alternative guidance. The agent must infer the selection criteria.

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