Skip to main content
Glama

get_metrics

Retrieve browser performance metrics and audit data for web pages to analyze loading times, resource usage, and optimization opportunities.

Instructions

Get metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_metrics': calls client.getMetrics() and returns the metrics data as formatted text content.
    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/index.ts:267-274 (registration)
    Registers the 'get_metrics' tool in the ListTools response, including its name, description, and empty input schema.
    { name: 'get_metrics', description: 'Get metrics', inputSchema: { type: 'object', properties: {}, }, },
  • Defines the input schema for the 'get_metrics' tool (empty object, no parameters required).
    inputSchema: { type: 'object', properties: {}, },
  • Helper method in BrowserlessClient that fetches metrics via HTTP GET to '/metrics' endpoint and handles errors.
    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); } }

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