Skip to content

Commit 6cfc977

Browse files
authored
fix: add core web vitals to performance_start_trace description (#168)
Fixes #124 and #159. People have reported that when asked for CWV metrics, the AI will use `evaluate_script` to inject some code into the page to gather them. But, we want to encourage it to record a trace instead and use those values. After some testing locally, adding CWV explicitly to the description makes it much more reliable that the AI will reach for trace recording when asked about CWVs.
1 parent 869dd42 commit 6cfc977

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

docs/tool-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@
229229

230230
### `performance_start_trace`
231231

232-
**Description:** Starts a performance trace recording on the selected page.
232+
**Description:** Starts a performance trace recording on the selected page. This can be used to look for performance problems and insights to improve the performance of the page. It will also report Core Web Vital (CWV) scores for the page.
233233

234234
**Parameters:**
235235

236236
- **autoStop** (boolean) **(required)**: Determines if the trace recording should be automatically stopped.
237-
- **reload** (boolean) **(required)**: Determines if, once tracing has started, the page should be automatically reloaded
237+
- **reload** (boolean) **(required)**: Determines if, once tracing has started, the page should be automatically reloaded.
238238

239239
---
240240

src/tools/performance.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import {defineTool} from './ToolDefinition.js';
2222

2323
export const startTrace = defineTool({
2424
name: 'performance_start_trace',
25-
description: 'Starts a performance trace recording on the selected page.',
25+
description:
26+
'Starts a performance trace recording on the selected page. This can be used to look for performance problems and insights to improve the performance of the page. It will also report Core Web Vital (CWV) scores for the page.',
2627
annotations: {
2728
category: ToolCategories.PERFORMANCE,
2829
readOnlyHint: true,
@@ -31,7 +32,7 @@ export const startTrace = defineTool({
3132
reload: z
3233
.boolean()
3334
.describe(
34-
'Determines if, once tracing has started, the page should be automatically reloaded',
35+
'Determines if, once tracing has started, the page should be automatically reloaded.',
3536
),
3637
autoStop: z
3738
.boolean()

0 commit comments

Comments
 (0)