Skip to main content
Glama

inject_script

Register a named script that runs automatically on every page navigation, ensuring persistent custom browser automation behavior across sessions.

Instructions

Register a named persistent script that replays on every navigation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
nameYes
run_nowNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description must carry the burden. It discloses the key behavioral facts: the script is persistent and replays on every navigation. However, it does not mention the run_now default, whether registering an existing name overwrites it, or what the call returns, leaving meaningful behavioral gaps.

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?

A single sentence contains the core action, the resource, and the key behavioral condition, with no filler or redundant phrasing. It is front-loaded and efficient.

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 flat 3-parameter tool with no output schema, the description covers the main concept but omits the run_now behavior and any guidance about overwriting or re-registration. An agent could infer most of the call shape but would still be guessing about an important parameter.

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 description coverage is 0%, so the description needs to compensate for the undocumented parameters. It does not mention name, code, or run_now at all. While name and code are inferable from 'script', run_now's semantics and default are entirely absent.

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 uses a specific verb ('Register') and resource ('named persistent script') and clearly states the defining behavior ('replays on every navigation'). This distinguishes it from sibling execute_js, which implies one-off execution, so an agent can identify this tool's unique role.

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 persistent, replay-on-navigation behavior implicitly tells the agent when to use this tool, but there is no explicit guidance contrasting it with execute_js or send_to_injected. No exclusions or alternative-selection conditions are provided, so usage guidance is only implied.

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