feat(mcp): snapshot read tools - #7720
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7720 +/- ##
==========================================
+ Coverage 76.19% 76.35% +0.15%
==========================================
Files 443 443
Lines 23726 23731 +5
Branches 6314 6314
==========================================
+ Hits 18079 18120 +41
+ Misses 5647 5611 -36
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:
|
5fa6a86 to
84edc1f
Compare
8bfb22e to
9742987
Compare
84edc1f to
64a8111
Compare
64a8111 to
09497ea
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
09497ea to
1d840cc
Compare
1d840cc to
33e0e46
Compare
33e0e46 to
04f3e3a
Compare
04f3e3a to
04bfd8b
Compare
|
@cstns reworked the snapshot read tools in 49a1cad based on your review, taking a slightly different route than the literal suggestions:
Let me know if you'd prefer different naming. |
|
Follow-up in 6d7de1a, continuing the consolidation and picking up your last comment:
Snapshot read/create tools are now: |
Summary
Adds the phase 1 read-only snapshot tools to
forge/ee/lib/mcp/tools/snapshots.js:platform_get_hosted_instance_snapshot-GET /api/v1/projects/:instanceId/snapshots/:snapshotIdplatform_get_remote_instance_snapshot-GET /api/v1/devices/:deviceId/snapshots/:snapshotIdplatform_get_snapshot-GET /api/v1/snapshots/:idplatform_get_snapshot_full-GET /api/v1/snapshots/:id/fullplatform_get_instance_device_settings-GET /api/v1/projects/:instanceId/devices/settingsAll tools are annotated
readOnlyHint: true, destructiveHint: false.Allow-lists the backing scopes for the
user:expert-mcptoken type inforge/routes/auth/permissions.js:project:snapshot:read,device:snapshot:read,snapshot:meta,snapshot:full.Base is
feat/mcp-tools-shared-schemassince this depends on the shared pagination schema fragments; it will retarget tomainonce that PR merges.Closes #7687
Consolidation notes
platform_list_instance_target_devicesis dropped: the unifiedplatform_list_remote_instancestool already lists a hosted instance's device-group members via itshostedInstanceIdargument, so a separate tool would duplicate it.Test plan
eslinton changed filesmochaon changed files