From fc772933e6cf1654c4fe821bc007720c0402c4ed Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Fri, 26 Sep 2025 13:51:08 +0100 Subject: [PATCH 1/2] fix: add core web vitals to performance_start_trace description 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. --- src/tools/performance.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/performance.ts b/src/tools/performance.ts index 6d0956cc..1225f551 100644 --- a/src/tools/performance.ts +++ b/src/tools/performance.ts @@ -22,7 +22,8 @@ import {defineTool} from './ToolDefinition.js'; export const startTrace = defineTool({ name: 'performance_start_trace', - description: 'Starts a performance trace recording on the selected page.', + 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.', annotations: { category: ToolCategories.PERFORMANCE, readOnlyHint: true, @@ -31,7 +32,7 @@ export const startTrace = defineTool({ reload: z .boolean() .describe( - 'Determines if, once tracing has started, the page should be automatically reloaded', + 'Determines if, once tracing has started, the page should be automatically reloaded.', ), autoStop: z .boolean() From 30bda0b57cae001ed4a67e293a74ac850220dc16 Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Fri, 26 Sep 2025 13:56:36 +0100 Subject: [PATCH 2/2] fix docs --- docs/tool-reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tool-reference.md b/docs/tool-reference.md index 60b45e79..83873579 100644 --- a/docs/tool-reference.md +++ b/docs/tool-reference.md @@ -229,12 +229,12 @@ ### `performance_start_trace` -**Description:** Starts a performance trace recording on the selected page. +**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. **Parameters:** - **autoStop** (boolean) **(required)**: Determines if the trace recording should be automatically stopped. -- **reload** (boolean) **(required)**: Determines if, once tracing has started, the page should be automatically reloaded +- **reload** (boolean) **(required)**: Determines if, once tracing has started, the page should be automatically reloaded. ---