feat(mcp): search read tools - #7717
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7717 +/- ##
==========================================
+ Coverage 76.19% 76.21% +0.01%
==========================================
Files 443 444 +1
Lines 23726 23737 +11
Branches 6314 6314
==========================================
+ Hits 18079 18090 +11
Misses 5647 5647
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:
|
5ee0c36 to
ee4873a
Compare
8bfb22e to
9742987
Compare
ee4873a to
13df351
Compare
13df351 to
b6831b5
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
Add team-resource and instance search tools backed by the /api/v1/search routes.
b6831b5 to
23a565d
Compare
Both search tools accepted an empty or whitespace-only query, which the search endpoints treat as a guaranteed-empty call. Constrain query to a trimmed, non-empty string so the input is rejected before the request is made, and drop the description line describing the empty-query behaviour.
Testing results of new toolsLocal platform context these calls ran against:
This PR adds 2 read tools to a new platform_search_team_resourcesSearches across a team's applications, hosted instances, and remote instances (devices). Requires
platform_search_instancesSearches only the hosted and remote instances of a team. Requires
ConclusionBoth new tools in |
…-read # Conflicts: # forge/routes/auth/permissions.js
Summary
Adds Phase 1 read-only MCP tools for the search scope (Story 5, #7232).
Tool file:
forge/ee/lib/mcp/tools/search.jsTools added:
platform_search_team_resources-GET /api/v1/search- search across a team's applications, hosted instances, and remote instances (devices)platform_search_instances-GET /api/v1/search/instances- search a team's hosted and remote instancesBoth tools are read-only (
readOnlyHint: true,destructiveHint: false) and requireteamIdandquery.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 #7677