From ce397276b07b7a786ad785d1c62483ce9b4b7d24 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Wed, 15 Oct 2025 16:50:09 +0200 Subject: [PATCH 1/3] fix: better wording for evaluate_script --- docs/tool-reference.md | 2 +- src/tools/script.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tool-reference.md b/docs/tool-reference.md index a7e3925d5..cb1e0baf9 100644 --- a/docs/tool-reference.md +++ b/docs/tool-reference.md @@ -284,7 +284,7 @@ so returned values have to JSON-serializable. **Parameters:** - **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. +- **function** (string) **(required)**: A JavaScript function expression to be executed by the tool in the currently selected page. Example without arguments: `() => { return document.title }` or `async () => { diff --git a/src/tools/script.ts b/src/tools/script.ts index be46de55e..3fb1bd5de 100644 --- a/src/tools/script.ts +++ b/src/tools/script.ts @@ -19,7 +19,7 @@ so returned values have to JSON-serializable.`, }, schema: { function: z.string().describe( - `A JavaScript function to run in the currently selected page. + `A JavaScript function expression to be executed by the tool in the currently selected page. Example without arguments: \`() => { return document.title }\` or \`async () => { From ee92358d575173ddb3d3f962bf75d5d27ecb34cf Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Thu, 16 Oct 2025 11:38:20 +0200 Subject: [PATCH 2/3] Apply suggestion from @Lightning00Blade --- src/tools/script.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/script.ts b/src/tools/script.ts index 3fb1bd5de..be6349d16 100644 --- a/src/tools/script.ts +++ b/src/tools/script.ts @@ -19,7 +19,7 @@ so returned values have to JSON-serializable.`, }, schema: { function: z.string().describe( - `A JavaScript function expression to be executed by the tool in the currently selected page. + `A JavaScript function declaration to be executed by the tool in the currently selected page. Example without arguments: \`() => { return document.title }\` or \`async () => { From f29f5f3480dba5e486fae4158a7b36fc3932f15f Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Thu, 16 Oct 2025 11:38:38 +0200 Subject: [PATCH 3/3] Apply suggestion from @Lightning00Blade --- docs/tool-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tool-reference.md b/docs/tool-reference.md index cb1e0baf9..c95ed3d38 100644 --- a/docs/tool-reference.md +++ b/docs/tool-reference.md @@ -284,7 +284,7 @@ so returned values have to JSON-serializable. **Parameters:** - **args** (array) _(optional)_: An optional list of arguments to pass to the function. -- **function** (string) **(required)**: A JavaScript function expression to be executed by the tool in the currently selected page. +- **function** (string) **(required)**: A JavaScript function declaration to be executed by the tool in the currently selected page. Example without arguments: `() => { return document.title }` or `async () => {