feat(mcp): add FlowFuse Tables platform automation tools - #7990
Merged
Conversation
Adds platform_list_team_databases, platform_get_team_database, platform_list_database_tables, platform_get_database_table and platform_query_database_table_data tools so the MCP platform automation surface can list databases and tables and read row data for FlowFuse Tables. Database responses have their credentials stripped via a shared helper before being returned. Adds the team:database:list scope to the expert-mcp token's implicit scope list and unit tests covering the new handlers.
platform_get_database_table and platform_query_database_table_data now take a required schemaName, matching the schema disambiguation being added to the underlying table routes. The caller gets the schema from platform_list_database_tables, which already returns it per table.
Steve-Mcl
reviewed
Jul 28, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7990 +/- ##
==========================================
+ Coverage 75.86% 75.89% +0.02%
==========================================
Files 434 437 +3
Lines 23340 23392 +52
Branches 6209 6217 +8
==========================================
+ Hits 17708 17753 +45
- Misses 5632 5639 +7
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:
|
teams_spec.js only tested the ported Tables tools; the pre-existing list/get team tools and the redactDatabaseCredentials null-guard had no coverage.
added 2 commits
July 28, 2026 13:55
…ion wording platform_list_team_databases and platform_get_database_table now wrap their results in an object instead of a bare array, and all five Tables tools declare a zod outputSchema describing their response shape. Also removed the descriptions' explicit mention of stripping credentials, since it doesn't affect how the tool is called.
…ols-from-7722 # Conflicts: # forge/comms/platformAutomation.js
…emas Move the 5 FlowFuse Tables tools out of teams.js into tools/tables.js, and extract their repeated input/output field schemas (teamId, databaseId, tableName, schemaName, database shape, count/meta records) into a new tool-schemas/tables.js module, since the same fields are reused across both the input and output schemas. Also drops the plan-gated-feature caveat from tool descriptions and switches remaining .passthrough() calls to the non-deprecated .loose().
1 task
andypalmi
added a commit
that referenced
this pull request
Jul 28, 2026
## Summary
When FlowFuse Tables isn't enabled for a team's plan, every route under `/api/v1/teams/:teamId/databases` returns a plain 404: `{ code: 'not_found', error: 'Not Found - not available on team' }`. This is indistinguishable from a genuine "that database/table doesn't exist" response.
This came up while adding FlowFuse Tables as an MCP tool for Expert (see #7990): an LLM agent calling these tools has no signal that the feature simply isn't enabled versus the resource not existing, so it can't usefully tell the user "enable Tables for your team" instead of "that doesn't exist".
We discussed two options: augmenting the response with a new `reason`/`reasonCode` field (backward compatible, but introduces a new convention with no precedent in the codebase), versus just making the existing message explicit. Went with the latter since it's a plain string with no established contract around its exact wording, matches the clearest existing precedent (`forge/routes/api/assistant.js:185`), and needs no new convention.
Status code and `code` field are unchanged, only the `error` message now names the feature.
## Test plan
- [x] Lint passes
- No existing test asserts the old message text
Co-authored-by: andypalmi <andrea@flowfuse.com>
Steve-Mcl
reviewed
Jul 28, 2026
schemaName was already encoded in these two handlers; tableName wasn't, even though it's an unconstrained string that can contain characters that break URL path segments.
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
Steve-Mcl
approved these changes
Jul 28, 2026
Contributor
|
Tested locally - worked perfectly when combined with a skill in the expert. |
Steve-Mcl
enabled auto-merge (squash)
July 28, 2026 15:49
Steve-Mcl
disabled auto-merge
July 28, 2026 15:50
Steve-Mcl
enabled auto-merge (squash)
July 28, 2026 15:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
platform_list_team_databases,platform_get_team_database,platform_list_database_tables,platform_get_database_table, andplatform_query_database_table_datato the MCP platform automation tool set, covering FlowFuse Tables databases, tables, and row data.credentialsobject stripped via a shared helper (forge/ee/lib/mcp/utils.js) before being returned, since the underlying API includes a password in that object.team:database:listto theexpert-mcptoken's implicit scope allow-list.Closes #7989
Closes FlowFuse/engineering#213
Test plan
limitquery param