Skip to main content
Glama

run_performance_audit

Execute Lighthouse performance audits on websites to analyze and optimize loading speed, responsiveness, and overall user experience using Browserless MCP Server.

Instructions

Run Lighthouse performance audit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configNo
urlYes

Implementation Reference

  • src/index.ts:172-189 (registration)
    Tool registration in the MCP server's ListTools response, defining the tool name, description, and input schema.
    { name: 'run_performance_audit', description: 'Run Lighthouse performance audit', inputSchema: { type: 'object', properties: { url: { type: 'string' }, config: { type: 'object', properties: { extends: { type: 'string' }, settings: { type: 'object' }, }, }, }, required: ['url'], }, },
  • MCP server handler for callToolRequest, dispatching to BrowserlessClient and formatting response.
    case 'run_performance_audit': { if (!args) throw new Error('Arguments are required'); const result = await this.client!.runPerformanceAudit(args as any); if (result.success && result.data) { return { content: [ { type: 'text', text: 'Performance audit completed successfully.', }, { type: 'text', text: JSON.stringify(result.data, null, 2), }, ], }; } else { throw new Error(result.error || 'Failed to run performance audit'); } }
  • Core tool handler in BrowserlessClient: sends POST request to Browserless server /performance endpoint to execute the Lighthouse performance audit.
    async runPerformanceAudit(request: PerformanceRequest): Promise<BrowserlessResponse<PerformanceResponse>> { try { const response: AxiosResponse<PerformanceResponse> = await this.httpClient.post('/performance', request); return { success: true, data: response.data, }; } catch (error) { return this.handleError(error); } }
  • Zod schema and TypeScript type definition for PerformanceRequest input.
    export const PerformanceRequestSchema = z.object({ url: z.string(), config: z.object({ extends: z.string().optional(), settings: z.record(z.any()).optional(), }).optional(), }); export type PerformanceRequest = z.infer<typeof PerformanceRequestSchema>;
  • TypeScript interface for PerformanceResponse output.
    export interface PerformanceResponse { lighthouse: any; metrics: any; }

Other Tools

Related 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/Lizzard-Solutions/browserless-mcp'

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