Skip to main content
Glama

inject_script

Installs a script that runs before the page loads on every page load, or removes it by ID, to automate browser tasks.

Instructions

Instala un script que corre antes que la página en cada carga, o lo quita por id.

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": {
      "action": "<action>"
    },
    "name": "inject_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNo
tabIdNoPestaña objetivo. Por defecto la pestaña actual del agente.
actionYes
sourceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/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 burden, and it does disclose the key behavioral trait that the script runs before the page on every load (persistence, not a one-shot). However it omits how an id is obtained for 'remove' (generated on add vs. supplied by caller), whether removal fully cleans up, and any scope/security caveats for injecting code.

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?

A single compact sentence with the primary behavior front-loaded and no filler. It is efficient, though the add/remove split could be structured more explicitly than folded into one clause.

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

Completeness2/5

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

For a persistent code-injection tool with no annotations, no output schema, and 75% of parameters undocumented in the schema, the description is too thin. An agent still lacks the id lifecycle, source format, and persistence/cleanup semantics needed to call it confidently.

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 only 25% (just 'tabId' is documented), so the description must compensate. It partially does by mapping 'id' to removal and implying a script body for add, but it never names or explains 'source' (format, full code vs. URL/path) and leaves the origin of 'id' ambiguous, which is the most consequential gap.

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 names a specific verb and resource ('Instala un script') plus its key property ('corre antes que la página en cada carga') and covers the inverse operation ('lo quita por id'). An agent can tell it handles persistent pre-page-load script injection rather than one-off execution, though it does not name a sibling such as 'evaluate' or 'cdp' to draw the boundary.

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?

Usage is implied by the two modes described (add to install a per-load script, remove by id), so the action selection is inferable. There is no explicit guidance on when to prefer this over 'evaluate'/'cdp', no prerequisites, and no note on what state must exist before removal.

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