Skip to content

Commit 03f15c3

Browse files
committed
fix: remove cast
1 parent 9ad3f1e commit 03f15c3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

docs/tool-reference.md

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

299299
- **args** (array) _(optional)_: An optional list of arguments to pass to the function.
300300
- **function** (string) **(required)**: A JavaScript function declaration to be executed by the tool in the currently selected page.
301-
Example without arguments: `() => {
301+
Example without arguments: `() => {
302302
return document.title
303303
}` or `async () => {
304304
return await fetch("example.com")
305305
}`.
306-
Example with arguments: `(el) => {
306+
Example with arguments: `(el) => {
307307
return el.innerText;
308308
}`
309309

310+
310311
---
311312

312313
### `get_console_message`

src/tools/input.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import type {McpContext, TextSnapshotNode} from '../McpContext.js';
88
import {zod} from '../third_party/index.js';
9-
import type {ElementHandle, KeyInput} from '../third_party/index.js';
9+
import type {ElementHandle} from '../third_party/index.js';
1010
import {parseKey} from '../utils/keyboard.js';
1111

1212
import {ToolCategory} from './categories.js';
@@ -288,7 +288,7 @@ export const pressKey = defineTool({
288288
},
289289
handler: async (request, response, context) => {
290290
const page = context.getSelectedPage();
291-
const tokens = parseKey(request.params.key) as KeyInput[];
291+
const tokens = parseKey(request.params.key);
292292
const [key, ...modifiers] = tokens;
293293

294294
await context.waitForEventsAfterAction(async () => {

0 commit comments

Comments
 (0)