Skip to content

fix(mcp): stop empty UI-tool errors and tighten tool-usage guardrails#7911

Open
andypalmi wants to merge 2 commits into
fix/expert-mcp-latest-stack-and-specfrom
fix/ui-navigate-empty-error
Open

fix(mcp): stop empty UI-tool errors and tighten tool-usage guardrails#7911
andypalmi wants to merge 2 commits into
fix/expert-mcp-latest-stack-and-specfrom
fix/ui-navigate-empty-error

Conversation

@andypalmi

Copy link
Copy Markdown
Contributor

Stacked on #7908.

Summary

  • ui_navigate (and any other UI automation tool) could return Tool "X" failed: with nothing after the colon, because vue-router throws an Error with no message in production for an unknown route name, and the dispatcher's catch collapsed straight to err.message. The dispatcher now falls back to the error's own properties so the reason is never lost. ui_navigate also now catches resolve/push directly and returns a clean, structured failure. ui_list_routes no longer hides named redirect-only routes (like an application's landing route) from discovery.
  • Tightened a few tool descriptions so an id param can't be mistaken for a display name, and so platform_create_application / platform_create_remote_instance / platform_create_hosted_instance are explicit about checking for name collisions before creating and asking the user instead of guessing.

Closes

  • Closes FlowFuse/engineering#188
  • Closes FlowFuse/engineering#185
  • Closes FlowFuse/engineering#182
  • Closes FlowFuse/engineering#183

Test plan

  • npx vitest run --config ./config/vitest.config.ts test/unit/frontend/mcp/tools/navigation.spec.js test/unit/frontend/mcp/tools/routes.spec.js test/unit/frontend/services/automations.service.spec.js - all passing
  • npx eslint on all touched files - clean

andypalmi added 2 commits July 23, 2026 01:42
router.resolve throws an Error with no message (only extra own
properties) for an unknown route name in a production build, which the
dispatcher's catch collapsed to `err.message` and lost entirely. The
dispatcher now falls back to the error's own properties when message is
empty. ui_navigate also now catches resolve/push directly and returns a
clean, structured failure instead of letting an unnamed-route lookup
throw past it, and ui_list_routes stops hiding named redirect-only
routes (like an application's landing route) from route discovery.

Closes FlowFuse/engineering#188
…isions

ui_navigate's id param now warns explicitly that it must be a real
entity id from a list/get tool, never a display name, and clarifies
that success: true only confirms the route matched - not that the
target entity exists.

platform_create_application now says to check platform_list_applications
for a name collision before creating one. platform_create_remote_instance
now says to assign the device to an application right away when the user
references one, instead of leaving it unassigned by default.
platform_create_hosted_instance makes the name-availability check
mandatory and says to offer the user alternative names on a collision
rather than picking one silently.

Closes FlowFuse/engineering#185, FlowFuse/engineering#182, FlowFuse/engineering#183
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.64%. Comparing base (ec352c3) to head (026ba17).

Additional details and impacted files
@@                           Coverage Diff                            @@
##           fix/expert-mcp-latest-stack-and-spec    #7911      +/-   ##
========================================================================
- Coverage                                 75.65%   75.64%   -0.01%     
========================================================================
  Files                                       432      432              
  Lines                                     23087    23084       -3     
  Branches                                   6126     6124       -2     
========================================================================
- Hits                                      17466    17462       -4     
- Misses                                     5621     5622       +1     
Flag Coverage Δ
backend 75.64% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andypalmi
andypalmi requested a review from cstns July 23, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant