---
title: "corestack_company_performance_audit_gtmetrix_generate"
url: https://docs.corefinity.com/mcp/tools/corestack_company_performance_audit_gtmetrix_generate
type: tool
last_updated: 2026-11-13
feature: performance-audits
related:
  - https://docs.corefinity.com/guides/tools/performance-audits.md
---
# corestack_company_performance_audit_gtmetrix_generate

**Generate GTmetrix reports for an audit.** Start a GTmetrix test of each environment and page of a performance audit; each test uses GTmetrix credits. Scope: write. Long-running: answers with a task.

- Scope: `write`
- Confirmation: `confirm_count`
- Runs as a task: yes

## When to use it

Generate GTmetrix reports for a performance audit, as the Control Panel's Generate Reports does: one GTmetrix test for each environment × page of the audit (the environment's URL with the page's path). Each test uses GTmetrix credits, so ask the person first and tell them how many tests it buys. The tests are started in the background: the call answers a task to poll (corestack_task_get), and each test id is kept as GTmetrix gives it. When every test has started, the new reports replace the audit's earlier ones; read them with corestack_company_performance_audit_gtmetrix_reports_list (its `generation` follows this task too).

If a generation does not finish (GTmetrix refuses some tests, for example out of credits), the tests it started are kept, and the next generation at the same location buys only the rest: `confirm_count` is then that rest, and the refusal message says the number.

## Inputs

- `audit_id` (integer, ≥ 1, required)
- `location_id` (string, required): an `id` from corestack_company_performance_audit_gtmetrix_locations.
- `confirm_count` (integer, ≥ 1, required): the number of tests this buys, the audit's environments × its pages (corestack_company_performance_audit_get), or the rest after a generation that did not finish at the same location.

Answers a task. It ends with `{audit_id, id, status, location_id, resumed, tests, started, requested_at, finished_at, error, reports: [{name, test_id}], failures: [{name, error}]}`, each report named "environment page"; or `work_failed`, its message saying how many tests were not started and `details.generation` listing the ids started and each test GTmetrix refused.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "audit_id": {
      "minimum": 1,
      "type": "integer"
    },
    "confirm_count": {
      "description": "The number of tests this buys: environments × pages, or the rest after an unfinished generation at the same location.",
      "minimum": 1,
      "type": "integer"
    },
    "location_id": {
      "description": "An id from corestack_company_performance_audit_gtmetrix_locations.",
      "maxLength": 64,
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "audit_id",
    "location_id",
    "confirm_count"
  ],
  "type": "object"
}
```

## Refusals

- `tenant_mismatch`: no such audit, or it belongs to a company you may not access.
- `confirm_mismatch`: `confirm_count` is not the number of tests; the message says the number. Nothing was started.
- `run_in_progress`: a generation of this audit's reports is already queued or running. Wait for its task to end.
- `nothing_to_run`: the audit has no domains or pages to report on.
- `too_large`: the audit has more than 200 environment and page pairs (the audit form's 10 × 20). Nothing was started.
- `conflict`: two environment and page pairs have the same report name ("environment page"), by which reports are kept; the message names it. Rename an environment or a page first. Nothing was started.
- `invalid_arguments`: `location_id` is not one of GTmetrix's locations, or an argument is missing.
- `temporarily_unavailable`: GTmetrix is not set up on the Control Panel just now. Nothing was sent.
- `upstream_unavailable`: GTmetrix did not answer when its locations were checked. Nothing was started.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_company_performance_audit_gtmetrix_generate",
  "arguments": {
    "audit_id": 276,
    "location_id": "2",
    "confirm_count": 4
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_company_performance_audit_gtmetrix_generate with audit_id 276, location_id 2. (Generate GTmetrix reports for an audit.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [Performance audits](https://docs.corefinity.com/guides/tools/performance-audits.md)
