33namespace Binaryk \LaravelRestify \MCP \Concerns ;
44
55use Binaryk \LaravelRestify \Actions \Action ;
6- use Binaryk \LaravelRestify \Http \Requests \ActionRequest ;
76use Binaryk \LaravelRestify \MCP \Requests \McpActionRequest ;
8- use Binaryk \LaravelRestify \MCP \Requests \McpRequest ;
97use Laravel \Mcp \Server \Tools \ToolInputSchema ;
108
119/**
@@ -20,17 +18,16 @@ public function actionTool(Action $action, array $arguments, McpActionRequest $a
2018 $ this ->sanitizeToolRequest ($ actionRequest , $ arguments );
2119
2220 if ($ id = $ actionRequest ->input ('id ' )) {
23- if (!$ action ->authorizedToRun ($ actionRequest , $ actionRequest ->findModelOrFail ($ id ))) {
21+ if (! $ action ->authorizedToRun ($ actionRequest , $ actionRequest ->findModelOrFail ($ id ))) {
2422 return [
2523 'error ' => 'Not authorized to run this action ' ,
2624 'getter ' => $ action ->uriKey (),
2725 ];
2826 }
2927 }
3028
31-
3229 // Set up the action request context based on action type
33- if (!$ action ->isStandalone ()) {
30+ if (! $ action ->isStandalone ()) {
3431 if (isset ($ arguments ['id ' ])) {
3532 // Single model action (show context)
3633 $ actionRequest ->merge (['id ' => $ arguments ['id ' ]]);
@@ -41,7 +38,7 @@ public function actionTool(Action $action, array $arguments, McpActionRequest $a
4138 }
4239
4340 // Check authorization
44- if (!$ action ->authorizedToSee ($ actionRequest )) {
41+ if (! $ action ->authorizedToSee ($ actionRequest )) {
4542 return [
4643 'error ' => 'Not authorized to see this action ' ,
4744 'action ' => $ action ->uriKey (),
@@ -102,7 +99,7 @@ public static function actionToolSchema(Action $action, ToolInputSchema $schema,
10299 $ shownOnShow = $ action ->isShownOnShow ($ mcpRequest , app (static ::class));
103100 $ shownOnIndex = $ action ->isShownOnIndex ($ mcpRequest , app (static ::class));
104101
105- if ($ shownOnShow && !$ shownOnIndex ) {
102+ if ($ shownOnShow && ! $ shownOnIndex ) {
106103 // Show action - requires single ID
107104 $ schema ->string ('id ' )
108105 ->description ("The ID of the {$ modelName } to perform the action on " )
0 commit comments