Skip to main content
Glama

get_performance_metrics

Retrieve performance metrics like timing and memory usage for a specific Firefox browser tab using Playwright automation on the Firefox MCP Server.

Instructions

Get performance metrics (timing, memory usage)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdNo

Implementation Reference

  • The handler function that executes the get_performance_metrics tool. It retrieves performance timing, paint events, and memory usage from the browser page using Playwright's evaluate method on the Performance API.
    async getPerformanceMetrics(args = {}) {
      const { tabId } = args;
      const effectiveTabId = tabId || this.activeTabId;
      const page = this.getPage(effectiveTabId);
      
      // Get performance metrics from browser
      const metrics = await page.evaluate(() => {
        const nav = performance.getEntriesByType('navigation')[0];
        const paint = performance.getEntriesByType('paint');
        
        return {
          navigation: nav ? {
            domContentLoaded: nav.domContentLoadedEventEnd - nav.domContentLoadedEventStart,
            loadComplete: nav.loadEventEnd - nav.loadEventStart,
            totalTime: nav.loadEventEnd - nav.fetchStart
          } : null,
          paint: paint.map(p => ({ name: p.name, startTime: p.startTime })),
          memory: performance.memory ? {
            usedJSHeapSize: performance.memory.usedJSHeapSize,
            totalJSHeapSize: performance.memory.totalJSHeapSize,
            jsHeapSizeLimit: performance.memory.jsHeapSizeLimit
          } : null,
          timestamp: Date.now()
        };
      });
    
      return {
        content: [{
          type: 'text',
          text: `Performance Metrics:\n` + JSON.stringify(metrics, null, 2)
        }]
      };
    }
  • Registration of the get_performance_metrics tool in the ListToolsRequestSchema handler, including name, description, and input schema specifying optional tabId.
    {
      name: 'get_performance_metrics',
      description: 'Get performance metrics (timing, memory usage)',
      inputSchema: {
        type: 'object',
        properties: {
          tabId: { type: 'string' }
        }
      }
    },
  • Input schema definition for the get_performance_metrics tool, defining optional tabId parameter.
    {
      name: 'get_performance_metrics',
      description: 'Get performance metrics (timing, memory usage)',
      inputSchema: {
        type: 'object',
        properties: {
          tabId: { type: 'string' }
        }
      }
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states what is retrieved but doesn't disclose behavioral traits such as whether this is a read-only operation, if it requires specific permissions, how metrics are formatted, or if there are rate limits. The description is minimal and lacks essential context for safe invocation.

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 extremely concise with a single, front-loaded sentence that directly states the tool's purpose without any wasted words. It efficiently communicates the core functionality in minimal space.

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

Completeness2/5

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

Given the complexity of a performance metrics tool with no annotations, no output schema, and an undocumented parameter, the description is incomplete. It fails to provide necessary details on behavior, parameter usage, or output format, making it inadequate for reliable agent use.

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

Parameters2/5

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

The schema has 1 parameter with 0% description coverage, and the tool description provides no information about the 'tabId' parameter. It doesn't explain what 'tabId' is, how to obtain it, or its role in fetching metrics, leaving the parameter undocumented and unclear.

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 verb 'Get' and the resource 'performance metrics', specifying the types as 'timing, memory usage'. This provides a specific purpose, though it doesn't explicitly differentiate from sibling tools like 'get_all_debug_activity' or 'get_network_activity' that might also retrieve performance-related data.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or exclusions, leaving the agent to infer usage from the tool name alone among many sibling tools.

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

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/JediLuke/firefox-mcp-server'

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