get_metrics
Retrieve browser performance metrics and audit data for web pages using browser automation. Supports detailed analysis for optimization and debugging tasks.
Instructions
Get metrics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:267-274 (registration)Registration of the 'get_metrics' tool in the MCP server, including name, description, and empty input schema.{ name: 'get_metrics', description: 'Get metrics', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:592-610 (handler)MCP server handler for 'get_metrics' tool that delegates to client.getMetrics() and formats the response.case 'get_metrics': { const result = await this.client!.getMetrics(); if (result.success && result.data) { return { content: [ { type: 'text', text: 'Current metrics:', }, { type: 'text', text: JSON.stringify(result.data, null, 2), }, ], }; } else { throw new Error(result.error || 'Failed to get metrics'); } }
- src/client.ts:323-334 (handler)Core implementation of getMetrics in BrowserlessClient that performs HTTP GET to /metrics endpoint and handles response/error.async getMetrics(): Promise<BrowserlessResponse<any>> { try { const response: AxiosResponse<any> = await this.httpClient.get('/metrics'); return { success: true, data: response.data, }; } catch (error) { return this.handleError(error); } }