blixify-charts-mcp 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +154 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -575,6 +575,96 @@ class MetabaseServer {
|
|
|
575
575
|
required: ["dashboard_id"],
|
|
576
576
|
},
|
|
577
577
|
},
|
|
578
|
+
{
|
|
579
|
+
name: "add_card_to_dashboard",
|
|
580
|
+
description: "Add an existing card to a dashboard.",
|
|
581
|
+
inputSchema: {
|
|
582
|
+
type: "object",
|
|
583
|
+
properties: {
|
|
584
|
+
dashboard_id: {
|
|
585
|
+
type: "number",
|
|
586
|
+
description: "ID of the dashboard to add the card to",
|
|
587
|
+
},
|
|
588
|
+
card_id: {
|
|
589
|
+
type: "number",
|
|
590
|
+
description: "ID of the card to add",
|
|
591
|
+
},
|
|
592
|
+
row: {
|
|
593
|
+
type: "number",
|
|
594
|
+
description: "Row position (default: 0)",
|
|
595
|
+
default: 0,
|
|
596
|
+
},
|
|
597
|
+
col: {
|
|
598
|
+
type: "number",
|
|
599
|
+
description: "Column position (default: 0)",
|
|
600
|
+
default: 0,
|
|
601
|
+
},
|
|
602
|
+
size_x: {
|
|
603
|
+
type: "number",
|
|
604
|
+
description: "Width in grid units (default: 4)",
|
|
605
|
+
default: 4,
|
|
606
|
+
},
|
|
607
|
+
size_y: {
|
|
608
|
+
type: "number",
|
|
609
|
+
description: "Height in grid units (default: 4)",
|
|
610
|
+
default: 4,
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
required: ["dashboard_id", "card_id"],
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
name: "remove_card_from_dashboard",
|
|
618
|
+
description: "Remove a card from a dashboard (does not delete the card itself, just removes it from the dashboard).",
|
|
619
|
+
inputSchema: {
|
|
620
|
+
type: "object",
|
|
621
|
+
properties: {
|
|
622
|
+
dashboard_id: {
|
|
623
|
+
type: "number",
|
|
624
|
+
description: "ID of the dashboard",
|
|
625
|
+
},
|
|
626
|
+
dashcard_id: {
|
|
627
|
+
type: "number",
|
|
628
|
+
description: "ID of the dashboard card (dashcard) to remove. Use get_dashboard_cards to find this ID.",
|
|
629
|
+
},
|
|
630
|
+
},
|
|
631
|
+
required: ["dashboard_id", "dashcard_id"],
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
name: "update_dashboard_card",
|
|
636
|
+
description: "Update the position or size of a card in a dashboard.",
|
|
637
|
+
inputSchema: {
|
|
638
|
+
type: "object",
|
|
639
|
+
properties: {
|
|
640
|
+
dashboard_id: {
|
|
641
|
+
type: "number",
|
|
642
|
+
description: "ID of the dashboard",
|
|
643
|
+
},
|
|
644
|
+
dashcard_id: {
|
|
645
|
+
type: "number",
|
|
646
|
+
description: "ID of the dashboard card to update",
|
|
647
|
+
},
|
|
648
|
+
row: {
|
|
649
|
+
type: "number",
|
|
650
|
+
description: "New row position",
|
|
651
|
+
},
|
|
652
|
+
col: {
|
|
653
|
+
type: "number",
|
|
654
|
+
description: "New column position",
|
|
655
|
+
},
|
|
656
|
+
size_x: {
|
|
657
|
+
type: "number",
|
|
658
|
+
description: "New width in grid units",
|
|
659
|
+
},
|
|
660
|
+
size_y: {
|
|
661
|
+
type: "number",
|
|
662
|
+
description: "New height in grid units",
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
required: ["dashboard_id", "dashcard_id"],
|
|
666
|
+
},
|
|
667
|
+
},
|
|
578
668
|
],
|
|
579
669
|
};
|
|
580
670
|
});
|
|
@@ -900,6 +990,70 @@ class MetabaseServer {
|
|
|
900
990
|
};
|
|
901
991
|
}
|
|
902
992
|
}
|
|
993
|
+
case "add_card_to_dashboard": {
|
|
994
|
+
const { dashboard_id, card_id, row = 0, col = 0, size_x = 4, size_y = 4, } = request.params?.arguments || {};
|
|
995
|
+
if (!dashboard_id) {
|
|
996
|
+
throw new McpError(ErrorCode.InvalidParams, "Dashboard ID is required for add_card_to_dashboard");
|
|
997
|
+
}
|
|
998
|
+
if (!card_id) {
|
|
999
|
+
throw new McpError(ErrorCode.InvalidParams, "Card ID is required for add_card_to_dashboard");
|
|
1000
|
+
}
|
|
1001
|
+
const addCardBody = {
|
|
1002
|
+
cardId: card_id,
|
|
1003
|
+
row,
|
|
1004
|
+
col,
|
|
1005
|
+
size_x,
|
|
1006
|
+
size_y,
|
|
1007
|
+
};
|
|
1008
|
+
const response = await this.axiosInstance.post(`/api/dashboard/${dashboard_id}/cards`, addCardBody);
|
|
1009
|
+
return {
|
|
1010
|
+
content: [
|
|
1011
|
+
{
|
|
1012
|
+
type: "text",
|
|
1013
|
+
text: JSON.stringify(response.data, null, 2),
|
|
1014
|
+
},
|
|
1015
|
+
],
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
case "remove_card_from_dashboard": {
|
|
1019
|
+
const { dashboard_id, dashcard_id } = request.params?.arguments || {};
|
|
1020
|
+
if (!dashboard_id) {
|
|
1021
|
+
throw new McpError(ErrorCode.InvalidParams, "Dashboard ID is required for remove_card_from_dashboard");
|
|
1022
|
+
}
|
|
1023
|
+
if (!dashcard_id) {
|
|
1024
|
+
throw new McpError(ErrorCode.InvalidParams, "Dashcard ID is required for remove_card_from_dashboard");
|
|
1025
|
+
}
|
|
1026
|
+
await this.axiosInstance.delete(`/api/dashboard/${dashboard_id}/cards/${dashcard_id}`);
|
|
1027
|
+
return {
|
|
1028
|
+
content: [
|
|
1029
|
+
{
|
|
1030
|
+
type: "text",
|
|
1031
|
+
text: `Card ${dashcard_id} removed from dashboard ${dashboard_id}.`,
|
|
1032
|
+
},
|
|
1033
|
+
],
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
case "update_dashboard_card": {
|
|
1037
|
+
const { dashboard_id, dashcard_id, ...updateFields } = request.params?.arguments || {};
|
|
1038
|
+
if (!dashboard_id) {
|
|
1039
|
+
throw new McpError(ErrorCode.InvalidParams, "Dashboard ID is required for update_dashboard_card");
|
|
1040
|
+
}
|
|
1041
|
+
if (!dashcard_id) {
|
|
1042
|
+
throw new McpError(ErrorCode.InvalidParams, "Dashcard ID is required for update_dashboard_card");
|
|
1043
|
+
}
|
|
1044
|
+
if (Object.keys(updateFields).length === 0) {
|
|
1045
|
+
throw new McpError(ErrorCode.InvalidParams, "No fields provided for update_dashboard_card");
|
|
1046
|
+
}
|
|
1047
|
+
const response = await this.axiosInstance.put(`/api/dashboard/${dashboard_id}/cards/${dashcard_id}`, updateFields);
|
|
1048
|
+
return {
|
|
1049
|
+
content: [
|
|
1050
|
+
{
|
|
1051
|
+
type: "text",
|
|
1052
|
+
text: JSON.stringify(response.data, null, 2),
|
|
1053
|
+
},
|
|
1054
|
+
],
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
903
1057
|
default:
|
|
904
1058
|
return {
|
|
905
1059
|
content: [
|