@@ -16,14 +16,9 @@ const getDeviceComms = (app) => { return app.comms?.devices }
1616
1717/**
1818 * Maps a platform automation tool's wire definition into a catalog entry for the
19- * Expert permissions UI (#421). Platform tools carry standard MCP annotations
20- * (readOnlyHint / destructiveHint), which give the read/write/delete class. They
21- * run on the platform, not in Node-RED, so they have no nr-assistant version window
22- * (no minVersion/maxVersion — the UI treats their absence as always-available).
23- * `group: 'platform'` routes them to the FlowFuse Platform Tools section (groupOf()
24- * in the product-assistant store). The friendly label is the tool's own `title`; if a
25- * tool ever lacks one, fall back to deriving it from the name (strip the platform_
26- * prefix and title-case the rest).
19+ * Expert permissions UI. The read/write/delete class comes from the MCP annotations
20+ * (readOnlyHint / destructiveHint), and `group: 'platform'` routes it to the platform
21+ * section. The label is the tool's own `title`, falling back to a name-derived label.
2722 */
2823const curatePlatformTool = ( def ) => {
2924 const annotations = def . annotations || { }
@@ -586,16 +581,10 @@ module.exports = async function (app) {
586581 } )
587582
588583 /**
589- * Retrieve the curated tool catalog for the Expert's human-in-the-loop permissions UI
590- * (#421). Returns the merged catalog for both sections the UI shows:
591- * - flow-building tools, proxied from the agent service's /mcp/flow-tools endpoint
592- * (friendly catalog entries only — raw MCP identifiers never leave the backend);
593- * - FlowFuse platform tools, curated here from the platform automation handler
594- * (app.comms.platformAutomation) and tagged group:'platform'.
595- * A `hash` fingerprint of the flow-building catalog rides along so the browser refetches
596- * only when it changes. Team access + feature gating are enforced by the shared
597- * preHandler above; read/write classification on each entry is what the client uses to
598- * decide which tools a role may enable.
584+ * Returns the merged tool catalog for the Expert permissions UI: flow-building tools
585+ * proxied from the agent's /mcp/flow-tools endpoint, plus curated platform tools. A
586+ * `hash` of the flow-building catalog rides along so the browser refetches only when
587+ * it changes. Team access and feature gating are enforced by the shared preHandler.
599588 */
600589 app . get ( '/mcp/tools' , {
601590 schema : {
@@ -656,11 +645,10 @@ module.exports = async function (app) {
656645
657646 reply . send ( { catalog, hash : response . data ?. hash || null } )
658647 } catch ( error ) {
659- // TODO: decide with the team whether this belongs on the branch. The tool catalog
660- // is a non-fatal enhancement (the client swallows failures and gates safely with
661- // defaults). Never forward an upstream auth failure as our own 401 — the SPA's
662- // axios interceptor treats any 401 as session-expiry and logs the user out, which
663- // an unrelated expert-service token rejection must not trigger.
648+ // The tool catalog is a non-fatal enhancement (the client swallows failures and
649+ // gates safely with defaults). Never forward an upstream auth failure as our own
650+ // 401. The SPA's axios interceptor treats any 401 as session-expiry and logs the
651+ // user out, which an unrelated expert-service token rejection must not trigger.
664652 const upstreamStatus = error . response ?. status
665653 app . log . warn ( `[expert/mcp/tools] upstream tool-catalog fetch failed: status=${ upstreamStatus } msg=${ error . message } ` )
666654 if ( upstreamStatus === 401 || upstreamStatus === 403 ) {
0 commit comments