Skip to main content
Glama

performance_stop_trace

Read-only

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: {},
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true, indicating this is a safe read operation. The description adds context by specifying it stops an 'active performance trace recording', which implies it terminates a process but doesn't destroy data. It doesn't mention side effects like whether the trace data is saved or discarded, but with annotations covering safety, this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It front-loads the key action ('Stops') and efficiently conveys the purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, annotations provide safety context, and no output schema exists, the description is reasonably complete. It specifies the action and target, though it could benefit from clarifying what happens to the trace data after stopping, but this is a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it could have mentioned implicit dependencies like needing a selected page, though this is minor.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Stops') and the resource ('active performance trace recording on the selected page'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'performance_start_trace' or 'performance_analyze_insight', though the action is distinct enough to imply differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by mentioning 'active performance trace recording' and 'selected page', suggesting it should be used when a trace is already running. However, it doesn't provide explicit guidance on when to use this versus alternatives or any prerequisites beyond having an active trace.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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