Skip to content

fix(mcp): resolve stacks per instance type and expose an instance's specification#7908

Open
andypalmi wants to merge 3 commits into
mainfrom
fix/expert-mcp-latest-stack-and-spec
Open

fix(mcp): resolve stacks per instance type and expose an instance's specification#7908
andypalmi wants to merge 3 commits into
mainfrom
fix/expert-mcp-latest-stack-and-spec

Conversation

@andypalmi

Copy link
Copy Markdown
Contributor

Summary

  • Scope platform_list_stacks to a given instance type, and surface a defaultStack (the latest recommended stack) on both platform_list_hosted_instance_types and platform_list_stacks, so the agent has a way to resolve "the latest available stack" instead of picking from an undifferentiated, cross-type list.
  • Point platform_get_hosted_instance / platform_get_application_hosted_instances' descriptions at reading an instance's specification (instance type, stack, template) before creating another instance matching it, instead of guessing.

Test plan

  • Live-validated against a running instance: asked the agent to create 4 more instances "of the same specification" as an existing one — it called platform_get_hosted_instance first, read the real projectType/stack/template ids, and reused them exactly rather than guessing

Closes FlowFuse/engineering#163
Closes FlowFuse/engineering#194
Closes FlowFuse/engineering#180

andypalmi added 3 commits July 22, 2026 00:21
platform_list_stacks returned every stack across every instance type
with no way to tell which one was current, so "use the latest" was
ambiguous and a superseded Node-RED version could be selected.

Scope the tool to a chosen instance type, using the same projectType
filter as the real stacks endpoint, and surface that type's
defaultStack as the recommended latest version, both in the tool
description and in platform_create_hosted_instance's guidance.
The application-instances list carries no instance type, stack, or
template, and no tool description said so, so a request to read or
match an existing instance's specification had no reliable source and
could be answered with a guess reported as fact.

Note on the list tool that it omits the specification, and point both
it and the create-instance guidance at platform_get_hosted_instance,
which already returns the full specification.
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@43ef287). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
forge/ee/lib/mcp/tools/platform.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7908   +/-   ##
=======================================
  Coverage        ?   75.65%           
=======================================
  Files           ?      432           
  Lines           ?    23087           
  Branches        ?     6126           
=======================================
  Hits            ?    17466           
  Misses          ?     5621           
  Partials        ?        0           
Flag Coverage Δ
backend 75.65% <50.00%> (?)

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.

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