Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ec8be4

Browse files
committed
fix tinker
1 parent c1d3bb1 commit 0ec8be4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Mcp/Tools/Tinker.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ public function schema(JsonSchema $schema): array
2727
{
2828
return [
2929
'code' => $schema->string()
30-
->description('PHP code to execute')
30+
->description('PHP code to execute (without opening <?php tags)')
31+
->required(),
32+
'timeout' => $schema->integer()
33+
->description('Maximum execution time in seconds (default: 180)')
3134
->required(),
3235
];
3336
}
@@ -39,7 +42,7 @@ public function schema(JsonSchema $schema): array
3942
*/
4043
public function handle(Request $request): Response
4144
{
42-
$code = str_replace(['<?php', '?>'], '', (string) $request->string('code'));
45+
$code = str_replace(['<?php', '?>'], '', (string) $request->get('code'));
4346

4447
ini_set('memory_limit', '256M');
4548

0 commit comments

Comments
 (0)