Skip to main content
Glama
types.ts3.47 kB
import type { Browser, Page } from 'puppeteer'; export interface ConsoleLog { type: string; text: string; stack?: string; timestamp: string; } export interface NetworkRequest { type: 'request' | 'response'; url: string; method?: string; resourceType?: string; status?: number; statusText?: string; timestamp: string; } export interface BrowserState { browser: Browser | null; page: Page | null; consoleLogs: ConsoleLog[]; networkRequests: NetworkRequest[]; headless: boolean; // Controla se o browser está visível ou não } export interface NavigateArgs { url: string; waitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2'; timeout?: number; } export interface GetDomArgs { prettify?: boolean; } export interface GetElementArgs { selector: string; includeStyles?: boolean; includeAttributes?: boolean; } export interface ExecuteJsArgs { code: string; returnValue?: boolean; } export interface ScreenshotArgs { selector?: string; fullPage?: boolean; path?: string; } export interface GetConsoleLogsArgs { filterType?: 'all' | 'log' | 'error' | 'warning' | 'info'; clear?: boolean; } export interface GetNetworkActivityArgs { filterType?: 'all' | 'request' | 'response'; clear?: boolean; } export interface GetPageSourceArgs { includeScripts?: boolean; includeStyles?: boolean; } export interface QuerySelectorAllArgs { selector: string; limit?: number; } export interface ClickElementArgs { selector: string; waitForNavigation?: boolean; } export interface TypeTextArgs { selector: string; text: string; clearFirst?: boolean; } export interface EvaluateXPathArgs { xpath: string; } export interface ElementInfo { tagName: string; innerHTML: string; outerHTML: string; textContent: string; attributes?: Record<string, string>; computedStyles?: Record<string, string>; boundingBox: { x: number; y: number; width: number; height: number; }; } export interface PageInfo { title: string; url: string; domain: string; path: string; protocol: string; referrer: string; characterSet: string; contentType: string; readyState: string; lastModified: string; viewport: { width: number; height: number; }; screen: { width: number; height: number; }; documentElement: { scrollHeight: number; scrollWidth: number; }; } export interface PageSource { html: string; scripts: Array<{ src: string | null; inline: boolean; content: string | null; type: string; }>; styles: Array<{ inline: boolean; content?: string; href?: string; }>; links: Array<{ rel: string; href: string; type: string; }>; } export interface ElementSummary { tagName: string; className: string; id: string; textContent: string; outerHTML: string; } export interface OpenBrowserArgs { url?: string; headless?: boolean; width?: number; height?: number; } export interface LoginArgs { url: string; usernameSelector: string; passwordSelector: string; submitSelector: string; username: string; password: string; waitForSelector?: string; // Seletor para confirmar login bem-sucedido timeout?: number; delayAfterType?: number; // Delay após digitar (útil para SPAs) } export interface BrowserStatus { isOpen: boolean; headless: boolean; currentUrl: string | null; pageTitle: string | null; message: string; }

Implementation Reference

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