From 2152f6238ce87116ed57ddd3199c7b4e874ff9ce Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Mon, 22 Sep 2025 15:34:35 +0100 Subject: [PATCH 1/3] fix: add 'on the selected page' to performance tools To hopefully ensure the client makes sure to navigate to and select a page before starting the trace. Bug: 446171427 --- docs/tool-reference.md | 5 +++-- src/tools/performance.ts | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/tool-reference.md b/docs/tool-reference.md index 7a4a2b5d..1e16378f 100644 --- a/docs/tool-reference.md +++ b/docs/tool-reference.md @@ -277,15 +277,16 @@ so returned values have to JSON-serializable. - **args** (array) _(optional)_: An optional list of arguments to pass to the function. - **function** (string) **(required)**: A JavaScript function to run in the currently selected page. - Example without arguments: `() => { +Example without arguments: `() => { return document.title }` or `async () => { return await fetch("example.com") }`. - Example with arguments: `(el) => { +Example with arguments: `(el) => { return el.innerText; }` + --- ### `list_console_messages` diff --git a/src/tools/performance.ts b/src/tools/performance.ts index a59e73a3..c558ad7f 100644 --- a/src/tools/performance.ts +++ b/src/tools/performance.ts @@ -18,7 +18,7 @@ import {ToolCategories} from './categories.js'; export const startTrace = defineTool({ name: 'performance_start_trace', - description: 'Starts a performance trace recording', + description: 'Starts a performance trace recording on the selected page.', annotations: { category: ToolCategories.PERFORMANCE, readOnlyHint: true, @@ -98,7 +98,8 @@ export const startTrace = defineTool({ export const stopTrace = defineTool({ name: 'performance_stop_trace', - description: 'Stops the active performance trace recording', + description: + 'Stops the active performance trace recording on the selected page.', annotations: { category: ToolCategories.PERFORMANCE, readOnlyHint: true, @@ -116,7 +117,7 @@ export const stopTrace = defineTool({ export const analyzeInsight = defineTool({ name: 'performance_analyze_insight', description: - 'Provides more detailed information on a specific Performance Insight that was highlighed in the results of a trace recording', + 'Provides more detailed information on a specific Performance Insight that was highlighed in the results of a trace recording.', annotations: { category: ToolCategories.PERFORMANCE, readOnlyHint: true, From 339c293662d48fbfbc935c61913a3ad06f280745 Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Mon, 22 Sep 2025 15:40:12 +0100 Subject: [PATCH 2/3] fix doc format --- docs/tool-reference.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/tool-reference.md b/docs/tool-reference.md index 1e16378f..7a4a2b5d 100644 --- a/docs/tool-reference.md +++ b/docs/tool-reference.md @@ -277,16 +277,15 @@ so returned values have to JSON-serializable. - **args** (array) _(optional)_: An optional list of arguments to pass to the function. - **function** (string) **(required)**: A JavaScript function to run in the currently selected page. -Example without arguments: `() => { + Example without arguments: `() => { return document.title }` or `async () => { return await fetch("example.com") }`. -Example with arguments: `(el) => { + Example with arguments: `(el) => { return el.innerText; }` - --- ### `list_console_messages` From 8bfc74b83491eaa0f01cb4f41ca3cbc1dbd6e4a4 Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Mon, 22 Sep 2025 15:52:52 +0100 Subject: [PATCH 3/3] fix docs --- docs/tool-reference.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tool-reference.md b/docs/tool-reference.md index 7a4a2b5d..dd661efc 100644 --- a/docs/tool-reference.md +++ b/docs/tool-reference.md @@ -219,7 +219,7 @@ ### `performance_analyze_insight` -**Description:** Provides more detailed information on a specific Performance Insight that was highlighed in the results of a trace recording +**Description:** Provides more detailed information on a specific Performance Insight that was highlighed in the results of a trace recording. **Parameters:** @@ -229,7 +229,7 @@ ### `performance_start_trace` -**Description:** Starts a performance trace recording +**Description:** Starts a performance trace recording on the selected page. **Parameters:** @@ -240,7 +240,7 @@ ### `performance_stop_trace` -**Description:** Stops the active performance trace recording +**Description:** Stops the active performance trace recording on the selected page. **Parameters:** None