Skip to content

Commit 48c1e41

Browse files
committed
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
1 parent bfbdada commit 48c1e41

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/tool-reference.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,16 @@ so returned values have to JSON-serializable.
277277

278278
- **args** (array) _(optional)_: An optional list of arguments to pass to the function.
279279
- **function** (string) **(required)**: A JavaScript function to run in the currently selected page.
280-
Example without arguments: `() => {
280+
Example without arguments: `() => {
281281
return document.title
282282
}` or `async () => {
283283
return await fetch("example.com")
284284
}`.
285-
Example with arguments: `(el) => {
285+
Example with arguments: `(el) => {
286286
return el.innerText;
287287
}`
288288

289+
289290
---
290291

291292
### `list_console_messages`

src/tools/performance.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {ToolCategories} from './categories.js';
1818

1919
export const startTrace = defineTool({
2020
name: 'performance_start_trace',
21-
description: 'Starts a performance trace recording',
21+
description: 'Starts a performance trace recording on the selected page.',
2222
annotations: {
2323
category: ToolCategories.PERFORMANCE,
2424
readOnlyHint: true,
@@ -98,7 +98,8 @@ export const startTrace = defineTool({
9898

9999
export const stopTrace = defineTool({
100100
name: 'performance_stop_trace',
101-
description: 'Stops the active performance trace recording',
101+
description:
102+
'Stops the active performance trace recording on the selected page.',
102103
annotations: {
103104
category: ToolCategories.PERFORMANCE,
104105
readOnlyHint: true,
@@ -116,7 +117,7 @@ export const stopTrace = defineTool({
116117
export const analyzeInsight = defineTool({
117118
name: 'performance_analyze_insight',
118119
description:
119-
'Provides more detailed information on a specific Performance Insight that was highlighed in the results of a trace recording',
120+
'Provides more detailed information on a specific Performance Insight that was highlighed in the results of a trace recording.',
120121
annotations: {
121122
category: ToolCategories.PERFORMANCE,
122123
readOnlyHint: true,

0 commit comments

Comments
 (0)