fix: JSON Schema passthrough, collection lifecycle, and dashboard tab management#24
Open
aniravi24 wants to merge 4 commits intoCognitionAI:mainfrom
Open
fix: JSON Schema passthrough, collection lifecycle, and dashboard tab management#24aniravi24 wants to merge 4 commits intoCognitionAI:mainfrom
aniravi24 wants to merge 4 commits intoCognitionAI:mainfrom
Conversation
…ema generation
z.unknown() produces an empty JSON Schema `{}` which MCP clients
(like Claude Code) interpret as an empty object with no additional
properties allowed, causing all nested properties to be stripped
before reaching the server.
- dataset_query: z.unknown() → z.record(z.string(), z.any())
- data_authority: z.unknown() → z.record(z.string(), z.any())
- target arrays: z.array(z.unknown()) → z.array(z.any())
- parameter value: z.unknown() → z.any()
This produces explicit JSON Schema with additionalProperties
that MCP clients correctly preserve.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Metabase v0.57+ "Dashboard Questions" (cards created directly on a dashboard) have dashboard_id set and cannot have collection_id changed via the bulk move endpoints. This caused 400 errors when trying to move these cards to collections. Fixes: - move_to_collection: send dashboard_id=null for cards so Dashboard Questions are detached before the collection move - moveCards(): fix falsy check (if collectionId) that would skip collection_id=0 (root); add fallback to individual PUT calls when the bulk endpoint rejects Dashboard Questions - moveCardsToCollection(): same Dashboard Question fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- update_collection now exposes `archived` boolean for archiving/unarchiving - delete_collection archives first then deletes (Metabase requires trash before delete) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allows managing dashboard tabs through the MCP. Pass tabs array to override tabs (use [] to remove all tabs), or omit to preserve existing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Multiple fixes for MCP tool compatibility and missing Metabase API coverage:
z.unknown()produces empty JSON Schema{}, causing MCP clients to strip nested object properties. Replaced withz.record(z.string(), z.any())/z.array(z.any())for correct schema generation.delete_collectionnow archives before deleting (Metabase requires this). Addedarchivedparameter toupdate_collection.type: "question"with a non-nulldashboard_id— these should not be moved via collection API.tabsparameter toupdate_dashboard_cardstool. Pass[]to remove all tabs, or an array of tab objects to set specific tabs.Commits
fix: replace z.unknown() with z.any()/z.record()— JSON Schema generation fixfix: handle Metabase Dashboard Questions in move operations— prevent errors on dashboard-scoped questionsfix: add archived param to update_collection, fix delete_collection— collection archive-before-deletefeat: add tabs parameter to update_dashboard_cards tool— dashboard tab managementTest plan
dataset_querypassthrough works when creating/updating cards via MCPdelete_collectionsuccessfully archives then deletes (tested on Metabase v0.57)update_collectionwitharchived: trueworksupdate_dashboard_cardswithtabs: []removes all tabsupdate_dashboard_cardswith tab array preserves specified tabs and removes others