diff --git a/src/Mcp/Tools/Tinker.php b/src/Mcp/Tools/Tinker.php index d4dc384..73a4fa5 100644 --- a/src/Mcp/Tools/Tinker.php +++ b/src/Mcp/Tools/Tinker.php @@ -13,14 +13,14 @@ class Tinker extends Tool { - public function shouldRegister(): bool - { - return app()->environment() === 'local'; - } - public function description(): string { - return 'Execute PHP code in the Laravel application context, similar to artisan tinker. Most useful for debugging issues, checking if functions exists, and testing code snippets. Returns the output of the code, as well as whatever is "returned" using "return".'; + return <<<'DESCRIPTION' +Execute PHP code in the Laravel application context, like artisan tinker. +Use this for debugging issues, checking if functions exist, and testing code snippets. +You should not create models directly without explicit user approval. Prefer Unit/Feature tests using factories for functionality testing. Prefer existing artisan commands over custom tinker code. +Returns the output of the code, as well as whatever is "returned" using "return". +DESCRIPTION; } public function schema(ToolInputSchema $schema): ToolInputSchema diff --git a/tests/Feature/Mcp/Tools/TinkerTest.php b/tests/Feature/Mcp/Tools/TinkerTest.php index ca4e1e6..25aa106 100644 --- a/tests/Feature/Mcp/Tools/TinkerTest.php +++ b/tests/Feature/Mcp/Tools/TinkerTest.php @@ -151,17 +151,6 @@ function getToolResultData(ToolResult $result): array expect($tool->shouldRegister())->toBeTrue(); }); -test('should not register in non-local environment', function () { - $tool = new Tinker; - - // Test in production environment - app()->detectEnvironment(function () { - return 'production'; - }); - - expect($tool->shouldRegister())->toBeFalse(); -}); - test('uses custom timeout parameter', function () { $tool = new Tinker; $result = $tool->handle(['code' => 'return 2 + 2;', 'timeout' => 10]);