initialize_browserless
Establish connection to a Browserless instance for browser automation tasks like PDF generation, screenshots, content extraction, and web scraping.
Instructions
Initialize connection to Browserless instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | localhost | |
| port | No | ||
| token | Yes | ||
| protocol | No | http | |
| timeout | No | ||
| concurrent | No |
Implementation Reference
- src/index.ts:288-300 (handler)The handler logic for the 'initialize_browserless' tool. It parses the input arguments with BrowserlessConfigSchema, instantiates BrowserlessClient, retrieves health status, and returns a text response confirming initialization.case 'initialize_browserless': { const config = BrowserlessConfigSchema.parse(args); this.client = new BrowserlessClient(config); const health = await this.client.getHealth(); return { content: [ { type: 'text', text: `Browserless client initialized successfully. Health status: ${health.data?.status || 'unknown'}`, }, ], }; }
- src/index.ts:35-50 (schema)The input schema definition for the 'initialize_browserless' tool as registered in the list of available tools.{ name: 'initialize_browserless', description: 'Initialize connection to Browserless instance', inputSchema: { type: 'object', properties: { host: { type: 'string', default: 'localhost' }, port: { type: 'number', default: 3000 }, token: { type: 'string' }, protocol: { type: 'string', enum: ['http', 'https', 'ws', 'wss'], default: 'http' }, timeout: { type: 'number', default: 30000 }, concurrent: { type: 'number', default: 5 }, }, required: ['token'], }, },
- src/types.ts:3-13 (schema)Zod validation schema (BrowserlessConfigSchema) used in the handler to parse and validate the tool's input arguments.// Browserless configuration export const BrowserlessConfigSchema = z.object({ host: z.string().default('localhost'), port: z.number().default(3000), token: z.string(), protocol: z.enum(['http', 'https', 'ws', 'wss']).default('http'), timeout: z.number().default(30000), concurrent: z.number().default(5), }); export type BrowserlessConfig = z.infer<typeof BrowserlessConfigSchema>;