Skip to content

Commit 3749303

Browse files
committed
feat(tool): allow nullable arguments in execute method and default to empty array
1 parent e779230 commit 3749303

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Server/FastMcp/Tools/ToolManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ public function clear(): void
9797
* @param array<string, mixed> $arguments
9898
* @return mixed
9999
*/
100-
public function execute(string $name, array $arguments)
100+
public function execute(string $name, ?array $arguments)
101101
{
102+
$arguments = $arguments ?? [];
102103
$registeredTool = $this->get($name);
103104
if ($registeredTool === null) {
104105
throw ToolError::unknownTool($name);

0 commit comments

Comments
 (0)