feat(mcp): application read tools - #7716
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7716 +/- ##
==========================================
+ Coverage 75.94% 76.04% +0.09%
==========================================
Files 445 445
Lines 23990 23988 -2
Branches 6404 6398 -6
==========================================
+ Hits 18220 18241 +21
+ Misses 5770 5747 -23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f5e73f5 to
0024806
Compare
8bfb22e to
9742987
Compare
0024806 to
d9a1087
Compare
d9a1087 to
ac0cb49
Compare
103f9ae to
5773bdb
Compare
Add forge/ee/lib/mcp/schemas.js, a shared module of composable zod fragments the platform read tools import instead of redefining entity-id and pagination/search/sort/audit-log query fields in each tool file. - entity-id params: teamId, applicationId, hostedInstanceId (UUID), remoteInstanceId, snapshotId - query fragments composed per route by spreading only the params the backing finder honors: cursorParam/limitParam (basePagination), pageParam, searchQuery, sortParams, auditLogFilters - appendQuery serialises a tool's supported params onto the request URL The module lives one level above tools/ so the tool loader does not register it as a tool module. Closes #7669
eae081f to
e04360f
Compare
3a537c8 to
2182bda
Compare
2182bda to
d8bb05e
Compare
d8bb05e to
03bd44b
Compare
Rename platform_list_team_application_statuses to platform_list_team_instance_statuses and retitle it, since the endpoint returns the live status of each application's hosted and remote instances rather than a status of the application itself. Note that platform_list_application_snapshots also covers remote-instance snapshots, and list the free-text query filter the audit-log tool accepts.
The cursor and limit paging mechanics are already documented by the shared pagination schema fields, so the duplicate sentences in the audit-log and snapshot tool descriptions add nothing. Keep the newest-first note, since that ordering is not conveyed by the schema.
The MCP response formatter parses every tool response as JSON, so the audit-log CSV export route (text/csv) could not be returned. Remove the format argument and always read the audit-log entries.
Testing results of new/edited toolsLocal platform context these calls ran against:
This PR adds 2 read tools to platform_list_application_snapshotsLists the snapshots belonging to an application. Honors
Note: the underlying route returns platform_list_team_instance_statusesLists each application in a team with the live status of its hosted and remote instances.
platform_get_application_audit_log (extended)Reads the application audit log (newest first). The extension adds
ConclusionThe 3 new/edited tools in |
Summary
Phase 1 read-only MCP tools for the application resource, added to
forge/ee/lib/mcp/tools/applications.js:platform_list_application_snapshots-GET /applications/:applicationId/snapshotsplatform_list_team_instance_statuses-GET /teams/:teamId/applications/statusThis PR also extends the already-shipped
platform_get_application_audit_logtool with anincludeChildrenargument.Each tool describes the application resource, so all are filed with the existing application tools, following the one-file-per-resource convention.
platform_list_team_instance_statusesreturns the applications in a team with the live status of their instances and devices.All tools are annotated
readOnlyHint: true, destructiveHint: false.Permissions:
#8185 removed the hardcoded
user:expert-mcpscope allow-list, so expert MCP tokens now inherit the user's permissions gated by team role and no allow-list entries are needed.Closes #7690
Consolidation notes
platform_get_application_hosted_instances,platform_get_application_remote_instances,platform_get_application_instances_status) are not added, because the unifiedplatform_list_hosted_instancesandplatform_list_remote_instancestools already cover per-application listing via theirapplicationIdargument, and live status viaincludeLiveStatusonplatform_list_hosted_instances.platform_get_application_audit_loggains anincludeChildrenargument to pull in descendant entries within the chosen scope.Test plan
eslinton changed files passes with no errorsmochaunit tests pass