Gtmetrix

Learn how to use Gtmetrix with Composio

Overview

SLUG: GTMETRIX

Description

GTmetrix is a performance testing and monitoring tool that analyzes website speed, provides detailed performance reports, and helps optimize web applications for better user experience.

Authentication Details

generic_api_key
stringRequired

Connecting to Gtmetrix

Create an auth config

Use the dashboard to create an auth config for the Gtmetrix toolkit. This allows you to connect multiple Gtmetrix accounts to Composio for agents to use.

1

Select App

Navigate to Gtmetrix.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Gtmetrix Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4gtmetrix_auth_config_id = "ac_YOUR_GTMETRIX_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Gtmetrix for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, gtmetrix_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Gtmetrix toolkit’s playground

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Delete Page

Description

Tool to delete a specific page in GTmetrix. Use when you need to permanently remove a page resource.

Action Parameters

page_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete Report

Description

Tool to delete a GTmetrix report. Use when you need to remove an existing performance report from GTmetrix.

Action Parameters

report_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Browsers

Description

Tool to retrieve the list of available browsers for GTmetrix performance tests. Use when you need to see which browsers are available and their testing capabilities.

Action Parameters

Action Response

data
arrayRequired
error
successful
booleanRequired

Tool Name: Get Location Details

Description

Tool to retrieve location details from GTmetrix. Use when you need to get information about a specific GTmetrix test location including name, region, browser support, IP addresses, and access permissions.

Action Parameters

location_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Locations

Description

Tool to retrieve the list of available GTmetrix test locations. Use when you need to see which locations are available for testing and their details including supported browsers and access status.

Action Parameters

Action Response

data
arrayRequired
error
successful
booleanRequired

Tool Name: Get Page Details

Description

Tool to retrieve page details from the user's GTmetrix account. Use when you need to get comprehensive page information including URL, testing configuration, and monitoring frequency.

Action Parameters

page_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Page Reports

Description

Tool to retrieve the report list associated with a monitored page in GTmetrix. Use when you need to access historical performance data for a specific page. Supports pagination, sorting, and filtering.

Action Parameters

filter
page_id
stringRequired
page_number
page_size
sort

Action Response

data
arrayRequired
error
links
meta
successful
booleanRequired

Tool Name: Get Pages

Description

Tool to retrieve the page list from your GTmetrix account. Returns a paginated collection of monitored pages with their configurations and latest report information. Use when you need to view all monitored pages, check page configurations, or access latest report data.

Action Parameters

filter
page_number
page_size
sort

Action Response

data
arrayRequired
error
links
meta
successful
booleanRequired

Tool Name: Get Report

Description

Tool to retrieve a GTmetrix test report by its identifier. Use when you need to get comprehensive performance metrics, timing data, and links to resources for a specific report.

Action Parameters

report_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Simulated Device

Description

Tool to retrieve simulated device details. Use when you need information about a specific simulated device including its name, category, manufacturer, user agent, screen dimensions, and pixel ratio.

Action Parameters

simulated_device_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Simulated Devices

Description

Tool to retrieve the list of simulated devices available in GTmetrix. Use when you need to see available device profiles for testing.

Action Parameters

Action Response

data
arrayRequired
error
successful
booleanRequired

Tool Name: Get API Account Status

Description

Tool to retrieve the current API account state and remaining credits. Use to check available API credits, refill schedule, and account features.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Test Details

Description

Tool to retrieve test details for a specific GTMetrix test. Use when you need to check the status, configuration, or results of a previously initiated test.

Action Parameters

test_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Tests

Description

Tool to retrieve the test list from your GTmetrix account with pagination and filtering support. Use when you need to view tests with their state, timestamps, and configuration details.

Action Parameters

filter_browser
filter_created
filter_finished
filter_location
filter_started
filter_state
page_number
page_size
sort

Action Response

data
arrayRequired
error
links
meta
successful
booleanRequired

Tool Name: Retest Report

Description

Tool to initiate a retest of a completed GTmetrix report with same parameters. Use when you need to rerun a test using the exact same analysis parameters as the original test.

Action Parameters

report_id
stringRequired

Action Response

data
objectRequired
error
links
meta
successful
booleanRequired

Tool Name: Start Test

Description

Tool to start a new GTmetrix test for a specified URL. Use when you need to analyze website performance with configurable options like location, browser, and throttling.

Action Parameters

adblock
allow_url
block_url
browser
browser_dppx
browser_height
browser_rotate
browser_width
cookies
dns
httpauth_password
httpauth_username
location
report
retention
simulate_device
stop_onload
throttle
url
stringRequired
user_agent
video

Action Response

data
objectRequired
error
links
meta
successful
booleanRequired