Skip to main content
Glama

Inject Css

inject_css

Inject CSS into a page for its lifetime to hide cookie banners, paywalls, and modals or highlight elements for screenshots, enabling cleaner page interaction and capture.

Instructions

Inject , persists page lifetime. Hide cookie banner/paywall/modal, highlight for screenshot.

Ex: inject_css('t0', '.cookie-banner{display:none!important}') → {"injected":true}

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": {
      "tab_id": "<tab_id>",
      "css": "<css>"
    },
    "name": "inject_css"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssYes
tab_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/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 add one genuinely useful behavioral fact: styles persist only for the page lifetime (so they are lost on navigation). It does not say whether successive calls append or replace existing injected CSS, whether it must wait for page load, or what the failure case is, and the shown return value is already covered by the output schema.

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?

Very tight: behavior and scope first, use cases second, worked example last. The telegraphic style ('Inject <style>, persists page lifetime') costs a little readability but wastes no words.

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?

Return values needn't be described since an output schema exists, and the two required params are partly covered by the example. Still, for an unannotated mutation-ish tool the description leaves gaps: whether repeated calls stack, whether the style applies to iframes, and any prerequisite that the tab be loaded.

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 0%, so the description must compensate, and the example call does clarify positional semantics and shows the tab_id format ('t0') and a concrete CSS payload — more than the bare schema offers. However it never explains what tab_id refers to (presumably an id from list_tabs) or whether multiple rules can be passed in one string.

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?

Specific verb+resource ('Inject <style>') plus the key scoping fact that it persists for the page lifetime, and concrete use cases (hiding cookie banners/paywalls/modals, highlighting for screenshots). It never names a sibling, but no sibling in the list does CSS injection directly, so confusion risk is low.

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 two example scenarios imply when to reach for this (declutter before screenshot/extraction), but there is no explicit when-not-to-use and no pointer to alternatives such as evaluate or dynamic_hook for non-CSS DOM changes. Usage context is inferable rather than stated.

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