Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

read_stylesheets

Retrieve CSS stylesheets from a web page. Get all loaded stylesheets or filter by URL to inspect specific styling rules.

Instructions

Read CSS stylesheets loaded on the page. Returns all stylesheets or a specific one by URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoSpecific stylesheet URL to read (returns all if omitted)
tabIdNoTarget tab ID (defaults to active tab)
apiKeyNoAPI key for authentication

Implementation Reference

  • The tool handler for 'read_stylesheets' - an MCP tool registration that defines the tool logic. It receives optional 'url', 'tabId', and 'apiKey' parameters, sends a 'read_stylesheets' command via WebSocketBridge, and returns the result as JSON.
    server.tool(
      'read_stylesheets',
      'Read CSS stylesheets loaded on the page. Returns all stylesheets or a specific one by URL.',
      {
        url: z.string().optional().describe('Specific stylesheet URL to read (returns all if omitted)'),
        tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
        apiKey: z.string().optional().describe('API key for authentication'),
      },
      async ({ url, tabId, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'read_stylesheets',
          params: { url },
          tabId,
          apiKey,
        });
        if (!result.success) {
          return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
        }
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • Input schema for the 'read_stylesheets' tool: optional url (string), optional tabId (number), optional apiKey (string).
    {
      url: z.string().optional().describe('Specific stylesheet URL to read (returns all if omitted)'),
      tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
      apiKey: z.string().optional().describe('API key for authentication'),
    },
  • Registration of the registerDevtoolsSourcesTools function which contains the read_stylesheets tool.
    import { registerDevtoolsSourcesTools } from './devtools-sources.js';
  • Call to registerDevtoolsSourcesTools which registers the read_stylesheets tool on the server.
    registerDevtoolsSourcesTools(server, bridge);
Behavior3/5

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

No annotations exist, so description carries full burden. It discloses a non-destructive read operation but omits details on missing URLs, permissions, or authentication requirements for the apiKey parameter.

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?

Single sentence, front-loaded, every word contributes to meaning.

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?

Without an output schema, the description lacks detail on return format (e.g., array of objects with specific fields). Adequate for a simple read, but misses some context.

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?

All parameters have schema descriptions (100% coverage). The description adds minimal value by restating the url parameter's behavior; no new meaning for tabId or apiKey.

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?

Description clearly states reading CSS stylesheets, a specific resource, and distinguishes from siblings like modify_css and read_scripts.

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?

Provides no explicit guidance on when to use this tool vs alternatives (e.g., get_computed_styles, modify_css). Usage is implied by the action, but no exclusions or context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BrowserGenie/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server