Skip to main content
Glama

performance_stop_trace

Stop active performance trace recording in Chrome DevTools to analyze page performance metrics and identify optimization opportunities.

Instructions

Stops the active performance trace recording on the selected page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'performance_stop_trace' tool. Includes the name, description, empty schema, annotations, and handler function that delegates to the helper.
    export const stopTrace = defineTool({ name: 'performance_stop_trace', description: 'Stops the active performance trace recording on the selected page.', annotations: { category: ToolCategories.PERFORMANCE, readOnlyHint: true, }, schema: {}, handler: async (_request, response, context) => { if (!context.isRunningPerformanceTrace()) { return; } const page = context.getSelectedPage(); await stopTracingAndAppendOutput(page, response, context); }, });
  • Core helper function that stops the performance tracing on the page, parses the trace buffer, stores the result if successful, appends summary or error to response, and resets the running trace flag.
    async function stopTracingAndAppendOutput( page: Page, response: Response, context: Context, ): Promise<void> { try { const traceEventsBuffer = await page.tracing.stop(); const result = await parseRawTraceBuffer(traceEventsBuffer); response.appendResponseLine('The performance trace has been stopped.'); if (traceResultIsSuccess(result)) { context.storeTraceRecording(result); const traceSummaryText = getTraceSummary(result); response.appendResponseLine(traceSummaryText); } else { response.appendResponseLine( 'There was an unexpected error parsing the trace:', ); response.appendResponseLine(result.error); } } catch (e) { const errorText = e instanceof Error ? e.message : JSON.stringify(e); logger(`Error stopping performance trace: ${errorText}`); response.appendResponseLine( 'An error occurred generating the response for this trace:', ); response.appendResponseLine(errorText); } finally { context.setIsRunningPerformanceTrace(false); } }
  • Empty schema for performance_stop_trace tool (no input parameters).
    schema: {},

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/SHAY5555-gif/chrome-devtools-mcp'

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