Skip to main content
Glama

emulate_cpu

Simulate CPU throttling to test web page performance under constrained processing conditions by adjusting execution slowdown factors.

Instructions

Emulates CPU throttling by slowing down the selected page's execution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
throttlingRateYesThe CPU throttling rate representing the slowdown factor 1-20x. Set the rate to 1 to disable throttling

Implementation Reference

  • The handler function for the 'emulate_cpu' tool. It retrieves the selected page, extracts the throttlingRate from params, calls page.emulateCPUThrottling(throttlingRate), and sets the CPU throttling rate in context.
    handler: async (request, _response, context) => {
      const page = context.getSelectedPage();
      const {throttlingRate} = request.params;
    
      await page.emulateCPUThrottling(throttlingRate);
      context.setCpuThrottlingRate(throttlingRate);
    },
  • Zod schema for the tool input, defining 'throttlingRate' as a number from 1 to 20, where 1 disables throttling.
    schema: {
      throttlingRate: z
        .number()
        .min(1)
        .max(20)
        .describe(
          'The CPU throttling rate representing the slowdown factor 1-20x. Set the rate to 1 to disable throttling',
        ),
    },
  • The tool is defined and exported using defineTool, including name, description, annotations, schema, and handler. This serves as the registration point for the MCP tool.
    export const emulateCpu = defineTool({
      name: 'emulate_cpu',
      description: `Emulates CPU throttling by slowing down the selected page's execution.`,
      annotations: {
        category: ToolCategories.EMULATION,
        readOnlyHint: false,
      },
      schema: {
        throttlingRate: z
          .number()
          .min(1)
          .max(20)
          .describe(
            'The CPU throttling rate representing the slowdown factor 1-20x. Set the rate to 1 to disable throttling',
          ),
      },
      handler: async (request, _response, context) => {
        const page = context.getSelectedPage();
        const {throttlingRate} = request.params;
    
        await page.emulateCPUThrottling(throttlingRate);
        context.setCpuThrottlingRate(throttlingRate);
      },
    });
Behavior3/5

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

Annotations indicate readOnlyHint=false, confirming this is a mutation tool. The description adds that it 'slows down' execution, implying a performance impact, but doesn't detail side effects like whether throttling persists across page navigation or affects other pages. It doesn't contradict annotations.

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, efficient sentence that front-loads the core purpose ('Emulates CPU throttling') and adds essential context ('by slowing down the selected page's execution'). Every word earns its place with zero waste.

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

Completeness3/5

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

For a mutation tool with no output schema and minimal annotations, the description adequately covers the basic action but lacks details on behavioral impact (e.g., how throttling interacts with other tools) and doesn't explain return values. It's minimally viable given the simple parameter schema.

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

Parameters3/5

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

Schema description coverage is 100%, with throttlingRate fully documented in the schema (range 1-20, slowdown factor, disable at 1). The description adds no additional parameter semantics beyond what the schema provides, meeting the baseline for high coverage.

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 ('emulates CPU throttling') and the target ('selected page's execution'), which is specific and actionable. It distinguishes from siblings like emulate_network by focusing on CPU rather than network throttling, though it doesn't explicitly contrast with them.

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?

The description provides no guidance on when to use this tool versus alternatives like performance_start_trace or performance_analyze_insight. It mentions the selected page but doesn't clarify prerequisites (e.g., whether a page must be selected first using select_page).

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