Skip to main content
Glama
Pagewright (browser-mcp)

Pagewright (browser-mcp)

by zamansheikh

browser_inject_css

Temporarily inject CSS into a page to test styling fixes without editing source files, then screenshot or audit the result before applying changes to code.

Instructions

Live-test a CSS fix on the page without editing files: inject CSS (replaces the previous CSS with the same id), then screenshot/audit to verify. remove:true removes it. Once it looks right, apply the same change to the source code. Lost on reload.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_inject_css"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoName of this style block (default "default").
cssNo
tabIdNoTab to act on. Defaults to the tab last opened/selected by an agent, else the active tab.
appendNo
removeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the whole burden, and it does disclose valuable traits: same-id replacement semantics, remove:true as the deletion path, and that changes are 'lost on reload'. It stops short on scope questions an agent would care about — whether the style is per-tab, whether it survives navigation, and what the call returns or errors on.

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?

Front-loaded with the purpose and a colon-introduced mechanism, then the removal flag, then lifecycle. Dense and mostly waste-free, though the 'live-test without editing files / apply the same change to source' idea is stated twice.

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 5-parameter, non-persistent mutation tool with no annotations and no output schema, the description covers lifecycle and removal well but leaves 'append' undefined and says nothing about return values or failure modes. Adequate to invoke correctly, not 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 40%, so the description needs to compensate and only partly does: it explains 'remove' and implies 'id' through the same-id replacement note. 'append' and 'css' get no meaning beyond their type, and the relationship between append and replacement is left ambiguous.

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?

States a specific verb and resource ('inject CSS') plus the intent (live-test a fix without editing files) and the effect of replacing prior CSS with the same id. The 'screenshot/audit to verify' framing implicitly separates it from the pure capture/inspection siblings, though no sibling is named explicitly.

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?

Gives a clear when-to-use context (validate a CSS change live before touching source) and a follow-up workflow ('once it looks right, apply the same change to the source code'). It does not state when NOT to use it or name an alternative such as browser_evaluate for injecting styles, so exclusions are absent.

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