Skip to main content
Glama

browser_get_page_source

Retrieve the complete HTML source code of the current web page for analysis, testing, or data extraction purposes during browser automation.

Instructions

Get the current page source

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the 'browser_get_page_source' tool with an empty input schema and an inline handler that fetches the current page source using the WebDriver instance from StateManager and returns it in the response content.
    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}`, }, ], }; } });
  • src/tools/index.ts:9-9 (registration)
    Calls registerBrowserTools which includes the registration of browser_get_page_source among other browser tools.
    registerBrowserTools(server, stateManager);

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