feat(api): add counts to MCP server detail

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-01 22:34:34 +00:00
parent 929b6b97ca
commit 9553808595
2 changed files with 5 additions and 0 deletions

View file

@ -90,6 +90,9 @@ class McpApiController extends Controller
$server['resources'] = $this->enrichResourcesWithContent($server['resources'] ?? []);
}
$server['tool_count'] = count($server['tools'] ?? []);
$server['resource_count'] = count($server['resources'] ?? []);
return response()->json($server);
}

View file

@ -111,4 +111,6 @@ it('includes tool versions and resource content on server detail requests when r
$response->assertJsonPath('resources.0.uri', 'test-detail-server://documents/welcome');
$response->assertJsonPath('resources.0.content.message', 'Hello from the server detail endpoint');
$response->assertJsonPath('resources.0.content.version', 2);
$response->assertJsonPath('tool_count', 1);
$response->assertJsonPath('resource_count', 1);
});