Skip to main content
Glama

Code Action

importio_action_code
Destructive

Run a JavaScript snippet through the upstream CodeAction inside an importio_play_action pipeline. Do not assume this runs in page DOM context; browser globals such as document or window may be unavailable. Do not use this for DOM scraping on unknown data pages. For DOM inspection or interaction, use importio_web_fetch, importio_get_html with options.replaceAssets=false, and selector-based actions.

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": {
      "fields": "<fields>"
    },
    "name": "importio_action_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputNoOptional second playAction argument forwarded after the envelope; omit it unless the upstream action expects one.
fieldsYesAction-specific configuration forwarded into the action envelope; each tool description states what it should contain where that contract is documented, otherwise it names the upstream configuration fields carries.
optionalNoFlag forwarded into the action envelope; omit it unless the upstream action documents it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / fields / description
      Added value: +"Action-specific configuration forwarded into the action envelope; each tool description states what it should contain where that contract is documented, otherwise it names the upstream configuration fields carries."
    • addedInput schema / properties / input / description
      Added value: +"Optional second playAction argument forwarded after the envelope; omit it unless the upstream action expects one."
    • addedInput schema / properties / optional / description
      Added value: +"Flag forwarded into the action envelope; omit it unless the upstream action documents it."
  2. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, idempotentHint=false and readOnlyHint=false, so the safety profile is covered. The description adds genuinely non-obvious context that the annotations cannot convey: the snippet does not reliably run in page DOM scope and browser globals such as document or window may be absent. It still says nothing about what the executed code can reach, how failures surface, or why the operation is destructive.

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?

Three sentences, front-loaded with the action and then the two constraints, with no filler. The final sentence is a slightly long tool list but each name earns its place as a concrete alternative.

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 destructive, open-world code-execution tool with no output schema and nested object parameters, the description covers the biggest pitfall (no DOM context) well. It leaves out how the code is supplied, what the execution scope exposes, and what a call returns or how it fails, which matters more here than for a simple read tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is nominally 100%, but the `fields` schema explicitly defers to the tool description for its contract ('each tool description states what it should contain'), and this description never says that the JavaScript source belongs in `fields` or what shape it takes. `input` and `optional` are likewise unaddressed, so the one thing an agent must get right, where the snippet goes, is left to guesswork.

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 first sentence names a specific verb and resource: run a JavaScript snippet via the upstream CodeAction inside an importio_play_action pipeline. It also distinguishes itself from the DOM-oriented siblings by warning that this is not page-context execution. It stops short of clarifying how this differs from importio_action_function, which is the closest-looking sibling.

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 gives explicit exclusions ('Do not use this for DOM scraping on unknown data pages') and routes the agent to named alternatives (importio_web_fetch, importio_get_html with options.replaceAssets=false, selector-based actions). What it lacks is a positive statement of the situation that selects this tool over importio_action_function or the other importio_action_* step tools.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources