Beautiful Open-Source Form Builder
feat: add MCP output schemas (#1271)
Julien Nahum51a44c43e380
diff --git a/api/app/Mcp/Support/McpOutputSchema.php b/api/app/Mcp/Support/McpOutputSchema.phpnew file mode 100644index 000000000..3af214963--- /dev/null+++ b/api/app/Mcp/Support/McpOutputSchema.php@@ -0,0 +1,107 @@+<?php++namespace App\Mcp\Support;++use Illuminate\Contracts\JsonSchema\JsonSchema;+use Illuminate\JsonSchema\Types\ObjectType;++final class McpOutputSchema+{+ public static function draft(JsonSchema $schema): ObjectType+ {+ return $schema->object([+ 'version' => $schema->integer()->min(1)->required(),+ 'schema_version' => $schema->integer()->min(1)->required(),+ 'status' => $schema->string()->required(),+ 'expires_at' => $schema->string()->format('date-time')->required(),+ 'definition' => $schema->object()->required(),+ ])->withoutAdditionalProperties();+ }++ public static function workspace(JsonSchema $schema): ObjectType+ {+ return $schema->object([+ 'id' => $schema->integer()->min(1)->required(),+ 'name' => $schema->string()->required(),+ 'icon' => $schema->string()->nullable()->required(),+ 'role' => $schema->string()->nullable()->required(),+ 'can_write_forms' => $schema->boolean()->required(),+ 'plan_tier' => $schema->string()->nullable()->required(),+ ])->withoutAdditionalProperties();+ }++ public static function pagination(JsonSchema $schema): ObjectType+ {+ return $schema->object([+ 'page' => $schema->integer()->min(1)->required(),+ 'per_page' => $schema->integer()->min(1)->required(),+ 'total' => $schema->integer()->min(0)->required(),+ 'last_page' => $schema->integer()->min(1)->required(),+ ])->withoutAdditionalProperties();+ }++ public static function formSummary(JsonSchema $schema): ObjectType+ {+ return $schema->object([+ 'id' => $schema->integer()->min(1)->required(),+ 'workspace_id' => $schema->integer()->min(1)->required(),+ 'title' => $schema->string()->required(),+ 'visibility' => $schema->string()->required(),+ 'share_url' => $schema->string()->format('uri')->required(),+ 'submissions_count' => $schema->integer()->min(0)->required(),+ 'views_count' => $schema->integer()->min(0)->required(),+ 'created_at' => $schema->string()->format('date-time')->nullable()->required(),+ 'updated_at' => $schema->string()->format('date-time')->nullable()->required(),+ ])->withoutAdditionalProperties();+ }++ public static function form(JsonSchema $schema): ObjectType+ {+ return $schema->object([+ 'id' => $schema->integer()->min(1)->required(),+ 'workspace_id' => $schema->integer()->min(1)->required(),+ 'title' => $schema->string()->required(),+ 'visibility' => $schema->string()->required(),+ 'share_url' => $schema->string()->format('uri')->required(),+ 'submissions_count' => $schema->integer()->min(0)->required(),+ 'views_count' => $schema->integer()->min(0)->required(),+ 'created_at' => $schema->string()->format('date-time')->nullable()->required(),+ 'updated_at' => $schema->string()->format('date-time')->nullable()->required(),+ 'definition' => $schema->object()->required(),+ 'revision' => $schema->string()->min(64)->max(64)->required(),+ 'edit_url' => $schema->string()->format('uri')->required(),+ ])->withoutAdditionalProperties();+ }++ public static function submission(JsonSchema $schema): ObjectType+ {+ return $schema->object([+ 'id' => $schema->integer()->min(1)->required(),+ 'form_id' => $schema->integer()->min(1)->required(),+ 'status' => $schema->string()->required(),+ 'created_at' => $schema->string()->format('date-time')->nullable()->required(),+ 'updated_at' => $schema->string()->format('date-time')->nullable()->required(),+ 'completion_time_seconds' => $schema->number()->min(0)->nullable()->required(),+ 'responses' => $schema->union(['object', 'array'])->required(),+ 'ip_address' => $schema->string(),+ ])->withoutAdditionalProperties();+ }++ public static function fieldSummary(JsonSchema $schema): ObjectType+ {+ return $schema->object([+ 'total_submissions' => $schema->integer()->min(0)->required(),+ 'processed_submissions' => $schema->integer()->min(0)->required(),+ 'is_limited' => $schema->boolean()->required(),+ 'fields' => $schema->array()->items($schema->object([+ 'id' => $schema->string()->required(),+ 'name' => $schema->string()->required(),+ 'type' => $schema->string()->required(),+ 'answered_count' => $schema->integer()->min(0)->required(),+ 'total_submissions' => $schema->integer()->min(0)->required(),+ 'summary_type' => $schema->string()->required(),+ 'data' => $schema->union(['object', 'array'])->required(),+ ])->withoutAdditionalProperties())->required(),+ ])->withoutAdditionalProperties();+ }+}diff --git a/api/app/Mcp/Tools/CreateFormDraftTool.php b/api/app/Mcp/Tools/CreateFormDraftTool.phpindex 92a5a6262..64c5a7021 100644--- a/api/app/Mcp/Tools/CreateFormDraftTool.php+++ b/api/app/Mcp/Tools/CreateFormDraftTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\AgentFormDraftRateLimiter;use App\Service\Forms\AgentFormDraftService;use Illuminate\Contracts\JsonSchema\JsonSchema;@@ -58,4 +59,13 @@ class CreateFormDraftTool extends GuestDraftMcpTool->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'draft_token' => $schema->string()->min(43)->max(43)->required(),+ 'draft' => McpOutputSchema::draft($schema)->required(),+ 'next_steps' => $schema->array()->items($schema->string())->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/CreateFormTool.php b/api/app/Mcp/Tools/CreateFormTool.phpindex ca233ae52..5d8060c2d 100644--- a/api/app/Mcp/Tools/CreateFormTool.php+++ b/api/app/Mcp/Tools/CreateFormTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpFormManagementService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -43,4 +44,14 @@ class CreateFormTool extends AuthenticatedMcpTool'definition' => $schema->object()->description('Canonical OpnForm agent form definition v1.')->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'message' => $schema->string()->required(),+ 'form' => McpOutputSchema::form($schema)->required(),+ 'disabled_features' => $schema->union(['object', 'array'])->required(),+ 'next_step' => $schema->string()->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/ExportSubmissionsTool.php b/api/app/Mcp/Tools/ExportSubmissionsTool.phpindex 08afc2e36..8fb9fd533 100644--- a/api/app/Mcp/Tools/ExportSubmissionsTool.php+++ b/api/app/Mcp/Tools/ExportSubmissionsTool.php@@ -45,4 +45,13 @@ class ExportSubmissionsTool extends AuthenticatedMcpTool->max(1000),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'job_id' => $schema->string()->format('uuid')->required(),+ 'status' => $schema->string()->required(),+ 'message' => $schema->string()->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/GetAccountContextTool.php b/api/app/Mcp/Tools/GetAccountContextTool.phpindex 3cc57d966..4525198da 100644--- a/api/app/Mcp/Tools/GetAccountContextTool.php+++ b/api/app/Mcp/Tools/GetAccountContextTool.php@@ -2,7 +2,9 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpFormManagementService;+use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;use Laravel\Mcp\Response;use Laravel\Mcp\ResponseFactory;@@ -34,4 +36,17 @@ class GetAccountContextTool extends AuthenticatedMcpTool'workspace_selection_required' => count($workspaces) > 1,]);}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'account' => $schema->object([+ 'id' => $schema->integer()->min(1)->required(),+ 'name' => $schema->string()->required(),+ 'email' => $schema->string()->format('email')->required(),+ ])->withoutAdditionalProperties()->required(),+ 'workspaces' => $schema->array()->items(McpOutputSchema::workspace($schema))->required(),+ 'workspace_selection_required' => $schema->boolean()->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/GetFormDraftTool.php b/api/app/Mcp/Tools/GetFormDraftTool.phpindex 5d9cb1162..16f38bb0e 100644--- a/api/app/Mcp/Tools/GetFormDraftTool.php+++ b/api/app/Mcp/Tools/GetFormDraftTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\AgentFormDraftService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -41,4 +42,9 @@ class GetFormDraftTool extends GuestDraftMcpTool->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return ['draft' => McpOutputSchema::draft($schema)->required()];+ }}diff --git a/api/app/Mcp/Tools/GetFormTool.php b/api/app/Mcp/Tools/GetFormTool.phpindex fc984c3e7..cbbdb7657 100644--- a/api/app/Mcp/Tools/GetFormTool.php+++ b/api/app/Mcp/Tools/GetFormTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpFormManagementService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -32,4 +33,9 @@ class GetFormTool extends AuthenticatedMcpTool{return ['form_id' => $schema->integer()->min(1)->required()];}++ public function outputSchema(JsonSchema $schema): array+ {+ return ['form' => McpOutputSchema::form($schema)->required()];+ }}diff --git a/api/app/Mcp/Tools/GetSubmissionExportTool.php b/api/app/Mcp/Tools/GetSubmissionExportTool.phpindex 4378deca0..5dbfe52d1 100644--- a/api/app/Mcp/Tools/GetSubmissionExportTool.php+++ b/api/app/Mcp/Tools/GetSubmissionExportTool.php@@ -41,4 +41,18 @@ class GetSubmissionExportTool extends AuthenticatedMcpTool'job_id' => $schema->string()->description('Export job UUID returned by export_submissions.')->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'job_id' => $schema->string()->format('uuid')->required(),+ 'status' => $schema->string()->required(),+ 'progress' => $schema->integer()->min(0)->max(100)->required(),+ 'processed_submissions' => $schema->integer()->min(0)->nullable()->required(),+ 'total_submissions' => $schema->integer()->min(0)->nullable()->required(),+ 'file_url' => $schema->string()->format('uri')->nullable()->required(),+ 'expires_at' => $schema->string()->format('date-time')->nullable()->required(),+ 'error_message' => $schema->string()->nullable()->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/GetSubmissionStatsTool.php b/api/app/Mcp/Tools/GetSubmissionStatsTool.phpindex f7671a03d..9dfb1896e 100644--- a/api/app/Mcp/Tools/GetSubmissionStatsTool.php+++ b/api/app/Mcp/Tools/GetSubmissionStatsTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpSubmissionService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Illuminate\Validation\Rule;@@ -48,4 +49,25 @@ class GetSubmissionStatsTool extends AuthenticatedMcpTool'date_to' => $schema->string()->description('Inclusive ISO 8601 date.'),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'form_id' => $schema->integer()->min(1)->required(),+ 'filters' => $schema->object([+ 'status' => $schema->string()->required(),+ 'date_from' => $schema->string()->nullable()->required(),+ 'date_to' => $schema->string()->nullable()->required(),+ ])->withoutAdditionalProperties()->required(),+ 'overview' => $schema->object([+ 'views' => $schema->integer()->min(0)->required(),+ 'completed_submissions' => $schema->integer()->min(0)->required(),+ 'partial_submissions' => $schema->integer()->min(0)->required(),+ 'completion_rate' => $schema->number()->min(0)->required(),+ ])->withoutAdditionalProperties()->required(),+ 'filtered_submissions' => $schema->integer()->min(0)->required(),+ 'average_completion_seconds' => $schema->number()->min(0)->nullable()->required(),+ 'field_summary' => McpOutputSchema::fieldSummary($schema)->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/GetSubmissionTool.php b/api/app/Mcp/Tools/GetSubmissionTool.phpindex 03f1dc5f7..90703f2aa 100644--- a/api/app/Mcp/Tools/GetSubmissionTool.php+++ b/api/app/Mcp/Tools/GetSubmissionTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpSubmissionService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -43,4 +44,9 @@ class GetSubmissionTool extends AuthenticatedMcpTool'submission_id' => $schema->integer()->min(1)->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return ['submission' => McpOutputSchema::submission($schema)->required()];+ }}diff --git a/api/app/Mcp/Tools/GetWorkspaceTool.php b/api/app/Mcp/Tools/GetWorkspaceTool.phpindex a1d7790d3..63924c69d 100644--- a/api/app/Mcp/Tools/GetWorkspaceTool.php+++ b/api/app/Mcp/Tools/GetWorkspaceTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpFormManagementService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -33,4 +34,9 @@ class GetWorkspaceTool extends AuthenticatedMcpTool{return ['workspace_id' => $schema->integer()->min(1)->required()];}++ public function outputSchema(JsonSchema $schema): array+ {+ return ['workspace' => McpOutputSchema::workspace($schema)->required()];+ }}diff --git a/api/app/Mcp/Tools/ListFormsTool.php b/api/app/Mcp/Tools/ListFormsTool.phpindex 733d10b95..f090aa53f 100644--- a/api/app/Mcp/Tools/ListFormsTool.php+++ b/api/app/Mcp/Tools/ListFormsTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Models\Forms\Form;use App\Service\Forms\McpFormManagementService;use Illuminate\Contracts\JsonSchema\JsonSchema;@@ -52,4 +53,12 @@ class ListFormsTool extends AuthenticatedMcpTool'per_page' => $schema->integer()->min(1)->max(100)->default(20),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'forms' => $schema->array()->items(McpOutputSchema::formSummary($schema))->required(),+ 'pagination' => McpOutputSchema::pagination($schema)->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/ListSubmissionsTool.php b/api/app/Mcp/Tools/ListSubmissionsTool.phpindex ae327e31a..0e621bf58 100644--- a/api/app/Mcp/Tools/ListSubmissionsTool.php+++ b/api/app/Mcp/Tools/ListSubmissionsTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpSubmissionService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Illuminate\Validation\Rule;@@ -57,4 +58,12 @@ class ListSubmissionsTool extends AuthenticatedMcpTool'per_page' => $schema->integer()->min(1)->max(100)->default(50),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'submissions' => $schema->array()->items(McpOutputSchema::submission($schema))->required(),+ 'pagination' => McpOutputSchema::pagination($schema)->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/ListWorkspacesTool.php b/api/app/Mcp/Tools/ListWorkspacesTool.phpindex 6bc177416..66921e336 100644--- a/api/app/Mcp/Tools/ListWorkspacesTool.php+++ b/api/app/Mcp/Tools/ListWorkspacesTool.php@@ -2,7 +2,9 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpFormManagementService;+use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;use Laravel\Mcp\Response;use Laravel\Mcp\ResponseFactory;@@ -25,4 +27,11 @@ class ListWorkspacesTool extends AuthenticatedMcpTool'workspaces' => $forms->listWorkspaces($this->user($request)),]);}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'workspaces' => $schema->array()->items(McpOutputSchema::workspace($schema))->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/OpenFormDraftInEditorTool.php b/api/app/Mcp/Tools/OpenFormDraftInEditorTool.phpindex 129539167..e02f61d07 100644--- a/api/app/Mcp/Tools/OpenFormDraftInEditorTool.php+++ b/api/app/Mcp/Tools/OpenFormDraftInEditorTool.php@@ -35,4 +35,13 @@ class OpenFormDraftInEditorTool extends GuestDraftMcpTool'draft_token' => $schema->string()->min(43)->max(43)->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'handoff_token' => $schema->string()->min(43)->max(43)->required(),+ 'editor_url' => $schema->string()->format('uri')->required(),+ 'expires_at' => $schema->string()->format('date-time')->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/PatchFormDraftTool.php b/api/app/Mcp/Tools/PatchFormDraftTool.phpindex 5aa3df635..e413645a4 100644--- a/api/app/Mcp/Tools/PatchFormDraftTool.php+++ b/api/app/Mcp/Tools/PatchFormDraftTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\AgentFormDraftService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -72,4 +73,12 @@ class PatchFormDraftTool extends GuestDraftMcpTool->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'draft' => McpOutputSchema::draft($schema)->required(),+ 'next_step' => $schema->string()->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/PreviewFormDraftTool.php b/api/app/Mcp/Tools/PreviewFormDraftTool.phpindex 3cac212bb..4d37fff43 100644--- a/api/app/Mcp/Tools/PreviewFormDraftTool.php+++ b/api/app/Mcp/Tools/PreviewFormDraftTool.php@@ -3,6 +3,7 @@namespace App\Mcp\Tools;use App\Mcp\Apps\FormDraftPreviewApp;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\AgentFormDraftService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -49,4 +50,14 @@ class PreviewFormDraftTool extends GuestDraftMcpTool->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'draft' => McpOutputSchema::draft($schema)->required(),+ 'preview_url' => $schema->string()->format('uri')->required(),+ 'editor_url' => $schema->string()->format('uri')->required(),+ 'editor_link_expires_at' => $schema->string()->format('date-time')->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/PublishFormTool.php b/api/app/Mcp/Tools/PublishFormTool.phpindex 42eb860b8..7d451b97c 100644--- a/api/app/Mcp/Tools/PublishFormTool.php+++ b/api/app/Mcp/Tools/PublishFormTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpFormManagementService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -44,4 +45,12 @@ class PublishFormTool extends AuthenticatedMcpTool'confirm_publish' => $schema->boolean()->description('True only after the user explicitly confirms publication.')->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'message' => $schema->string()->required(),+ 'form' => McpOutputSchema::form($schema)->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/TrashFormTool.php b/api/app/Mcp/Tools/TrashFormTool.phpindex be69154e2..1129dcbd1 100644--- a/api/app/Mcp/Tools/TrashFormTool.php+++ b/api/app/Mcp/Tools/TrashFormTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpFormManagementService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -44,4 +45,12 @@ class TrashFormTool extends AuthenticatedMcpTool'confirm_trash' => $schema->boolean()->description('True only after the user explicitly confirms moving the form to trash.')->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'message' => $schema->string()->required(),+ 'form' => McpOutputSchema::formSummary($schema)->required(),+ ];+ }}diff --git a/api/app/Mcp/Tools/UpdateFormTool.php b/api/app/Mcp/Tools/UpdateFormTool.phpindex 00a6ff461..dd94a766a 100644--- a/api/app/Mcp/Tools/UpdateFormTool.php+++ b/api/app/Mcp/Tools/UpdateFormTool.php@@ -2,6 +2,7 @@namespace App\Mcp\Tools;+use App\Mcp\Support\McpOutputSchema;use App\Service\Forms\McpFormManagementService;use Illuminate\Contracts\JsonSchema\JsonSchema;use Laravel\Mcp\Request;@@ -44,4 +45,13 @@ class UpdateFormTool extends AuthenticatedMcpTool'definition' => $schema->object()->description('Complete canonical OpnForm agent form definition v1.')->required(),];}++ public function outputSchema(JsonSchema $schema): array+ {+ return [+ 'message' => $schema->string()->required(),+ 'form' => McpOutputSchema::form($schema)->required(),+ 'disabled_features' => $schema->union(['object', 'array'])->required(),+ ];+ }}diff --git a/api/tests/Feature/Mcp/McpFoundationTest.php b/api/tests/Feature/Mcp/McpFoundationTest.phpindex 8971d1c53..935acb008 100644--- a/api/tests/Feature/Mcp/McpFoundationTest.php+++ b/api/tests/Feature/Mcp/McpFoundationTest.php@@ -123,6 +123,25 @@ it('advertises explicit safety annotations for every MCP tool', function () {expect($actual)->toBe($expected);});+it('publishes an output schema for every MCP tool', function () {+ $response = $this->postJson('/mcp', [+ 'jsonrpc' => '2.0',+ 'id' => 1,+ 'method' => 'tools/list',+ 'params' => [],+ ], [+ 'Accept' => 'application/json, text/event-stream',+ ])->assertOk();++ foreach ($response->json('result.tools') as $tool) {+ expect($tool['outputSchema'] ?? null)+ ->toBeArray("Tool [{$tool['name']}] must declare an output schema.")+ ->and($tool['outputSchema']['type'] ?? null)->toBe('object')+ ->and($tool['outputSchema']['properties'] ?? null)->toBeArray()+ ->not->toBeEmpty();+ }+});+it('mirrors every tool auth policy in metadata for ChatGPT compatibility', function () {$response = $this->postJson('/mcp', ['jsonrpc' => '2.0',