Skip to main content
Glama

get_page_info

Extract general page information for web debugging and analysis, including DOM structure, content details, and page properties to support development workflows.

Instructions

Obtém informações gerais sobre a página atual

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic of the 'get_page_info' tool. It evaluates various page properties like title, URL, dimensions, etc., in the browser context and returns them as JSON.
    export async function handleGetPageInfo(currentPage: Page): Promise<ToolResponse> {
      const info = await currentPage.evaluate((): PageInfo => {
        return {
          title: document.title,
          url: window.location.href,
          domain: window.location.hostname,
          path: window.location.pathname,
          protocol: window.location.protocol,
          referrer: document.referrer,
          characterSet: document.characterSet,
          contentType: document.contentType,
          readyState: document.readyState,
          lastModified: document.lastModified,
          viewport: {
            width: window.innerWidth,
            height: window.innerHeight,
          },
          screen: {
            width: window.screen.width,
            height: window.screen.height,
          },
          documentElement: {
            scrollHeight: document.documentElement.scrollHeight,
            scrollWidth: document.documentElement.scrollWidth,
          },
        };
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(info, null, 2),
          },
        ],
      };
    }
  • Schema definition for the 'get_page_info' tool, specifying no input parameters required.
      name: 'get_page_info',
      description: 'Obtém informações gerais sobre a página atual',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • src/index.ts:99-102 (registration)
    Dispatch registration in the main tool handler switch statement, which calls the get_page_info handler.
    case 'get_page_info': {
      const currentPage = await initBrowser();
      return await handleGetPageInfo(currentPage);
    }
  • src/tools.ts:185-191 (registration)
    Tool object in the exported tools array used for MCP tool registration and listing.
      name: 'get_page_info',
      description: 'Obtém informações gerais sobre a página atual',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },

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/EmmanuelBarbosaMonteiro/mcp-server-browser'

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