Skip to main content
Glama

browser_get_page_source

Retrieve the complete HTML source code of the current web page for analysis, debugging, or content extraction during browser automation.

Instructions

Get the current page source

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline handler function for the browser_get_page_source tool. It gets the current WebDriver instance from the StateManager, calls getPageSource() to retrieve the HTML source of the current page, and returns it formatted in the MCP response. Error handling returns an error message.
    server.tool('browser_get_page_source', 'Get the current page source', {}, async () => {
      try {
        const driver = stateManager.getDriver();
        const pageSource = await driver.getPageSource();
        return {
          content: [{ type: 'text', text: `Current page source is: ${pageSource}` }],
        };
      } catch (e) {
        return {
          content: [
            {
              type: 'text',
              text: `Error getting page source: ${(e as Error).message}`,
            },
          ],
        };
      }
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't reveal any behavioral traits such as whether it requires an active browser session, if it returns HTML or other formats, potential errors, or performance implications. For a tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is a single, clear sentence with zero waste—it directly states the tool's function without fluff. It's front-loaded and efficiently communicates the core purpose, making it easy for an agent to parse and understand quickly.

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?

Given the tool's complexity (simple read operation) but lack of annotations and output schema, the description is incomplete. It doesn't specify the return format (e.g., HTML string), error conditions, or dependencies like needing an open browser. For a tool with no structured data to supplement it, more context is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is applied as the description doesn't need to compensate for any schema gaps, and it correctly avoids unnecessary parameter information.

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 clearly states the action ('Get') and resource ('current page source'), making the purpose immediately understandable. It distinguishes itself from siblings like browser_get_url or browser_get_cookies by specifying the page source content rather than URL or cookies. However, it doesn't explicitly contrast with all possible siblings, keeping it at a 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios where page source is needed over other browser tools, prerequisites like needing an open page, or exclusions. This lack of contextual direction leaves the agent to infer usage based on the tool name alone.

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/pshivapr/selenium-mcp'

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