@standby/mcp-server-chart 0.9.10

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.
Files changed (87) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +285 -0
  3. package/build/charts/area.d.ts +41 -0
  4. package/build/charts/area.js +56 -0
  5. package/build/charts/bar.d.ts +41 -0
  6. package/build/charts/bar.js +57 -0
  7. package/build/charts/base.d.ts +30 -0
  8. package/build/charts/base.js +79 -0
  9. package/build/charts/boxplot.d.ts +40 -0
  10. package/build/charts/boxplot.js +50 -0
  11. package/build/charts/column.d.ts +41 -0
  12. package/build/charts/column.js +57 -0
  13. package/build/charts/dual-axes.d.ts +43 -0
  14. package/build/charts/dual-axes.js +59 -0
  15. package/build/charts/fishbone-diagram.d.ts +32 -0
  16. package/build/charts/fishbone-diagram.js +59 -0
  17. package/build/charts/flow-diagram.d.ts +39 -0
  18. package/build/charts/flow-diagram.js +45 -0
  19. package/build/charts/funnel.d.ts +36 -0
  20. package/build/charts/funnel.js +41 -0
  21. package/build/charts/histogram.d.ts +36 -0
  22. package/build/charts/histogram.js +45 -0
  23. package/build/charts/index.d.ts +26 -0
  24. package/build/charts/index.js +52 -0
  25. package/build/charts/line.d.ts +41 -0
  26. package/build/charts/line.js +52 -0
  27. package/build/charts/liquid.d.ts +39 -0
  28. package/build/charts/liquid.js +46 -0
  29. package/build/charts/mind-map.d.ts +30 -0
  30. package/build/charts/mind-map.js +43 -0
  31. package/build/charts/network-graph.d.ts +39 -0
  32. package/build/charts/network-graph.js +45 -0
  33. package/build/charts/organization-chart.d.ts +49 -0
  34. package/build/charts/organization-chart.js +60 -0
  35. package/build/charts/pie.d.ts +37 -0
  36. package/build/charts/pie.js +48 -0
  37. package/build/charts/radar.d.ts +38 -0
  38. package/build/charts/radar.js +49 -0
  39. package/build/charts/sankey.d.ts +43 -0
  40. package/build/charts/sankey.js +47 -0
  41. package/build/charts/scatter.d.ts +39 -0
  42. package/build/charts/scatter.js +47 -0
  43. package/build/charts/treemap.d.ts +44 -0
  44. package/build/charts/treemap.js +59 -0
  45. package/build/charts/venn.d.ts +37 -0
  46. package/build/charts/venn.js +49 -0
  47. package/build/charts/violin.d.ts +40 -0
  48. package/build/charts/violin.js +50 -0
  49. package/build/charts/waterfall.d.ts +44 -0
  50. package/build/charts/waterfall.js +73 -0
  51. package/build/charts/word-cloud.d.ts +36 -0
  52. package/build/charts/word-cloud.js +44 -0
  53. package/build/index.d.ts +2 -0
  54. package/build/index.js +73 -0
  55. package/build/sdk.d.ts +6 -0
  56. package/build/sdk.js +24 -0
  57. package/build/server.d.ts +17 -0
  58. package/build/server.js +151 -0
  59. package/build/services/index.d.ts +3 -0
  60. package/build/services/index.js +9 -0
  61. package/build/services/sse.d.ts +2 -0
  62. package/build/services/sse.js +59 -0
  63. package/build/services/stdio.d.ts +2 -0
  64. package/build/services/stdio.js +21 -0
  65. package/build/services/streamable.d.ts +2 -0
  66. package/build/services/streamable.js +58 -0
  67. package/build/utils/callTool.d.ts +18 -0
  68. package/build/utils/callTool.js +129 -0
  69. package/build/utils/env.d.ts +12 -0
  70. package/build/utils/env.js +38 -0
  71. package/build/utils/generate.d.ts +4 -0
  72. package/build/utils/generate.js +35 -0
  73. package/build/utils/image-server.d.ts +18 -0
  74. package/build/utils/image-server.js +66 -0
  75. package/build/utils/index.d.ts +3 -0
  76. package/build/utils/index.js +9 -0
  77. package/build/utils/local-render.d.ts +17 -0
  78. package/build/utils/local-render.js +121 -0
  79. package/build/utils/logger.d.ts +28 -0
  80. package/build/utils/logger.js +57 -0
  81. package/build/utils/schema.d.ts +4 -0
  82. package/build/utils/schema.js +12 -0
  83. package/build/utils/spec-translator.d.ts +12 -0
  84. package/build/utils/spec-translator.js +515 -0
  85. package/build/utils/validator.d.ts +34 -0
  86. package/build/utils/validator.js +76 -0
  87. package/package.json +66 -0
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports["word-cloud"] = exports.waterfall = exports.violin = exports.venn = exports.treemap = exports.scatter = exports.sankey = exports.radar = exports.pie = exports["organization-chart"] = exports["network-graph"] = exports["mind-map"] = exports.liquid = exports.line = exports.histogram = exports.funnel = exports["flow-diagram"] = exports["fishbone-diagram"] = exports["dual-axes"] = exports.column = exports.boxplot = exports.bar = exports.area = void 0;
4
+ /**
5
+ * export all charts as named exports to match the chart type
6
+ */
7
+ var area_1 = require("./area.js");
8
+ Object.defineProperty(exports, "area", { enumerable: true, get: function () { return area_1.area; } });
9
+ var bar_1 = require("./bar.js");
10
+ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { return bar_1.bar; } });
11
+ var boxplot_1 = require("./boxplot.js");
12
+ Object.defineProperty(exports, "boxplot", { enumerable: true, get: function () { return boxplot_1.boxplot; } });
13
+ var column_1 = require("./column.js");
14
+ Object.defineProperty(exports, "column", { enumerable: true, get: function () { return column_1.column; } });
15
+ var dual_axes_1 = require("./dual-axes.js");
16
+ Object.defineProperty(exports, "dual-axes", { enumerable: true, get: function () { return dual_axes_1.dualAxes; } });
17
+ var fishbone_diagram_1 = require("./fishbone-diagram.js");
18
+ Object.defineProperty(exports, "fishbone-diagram", { enumerable: true, get: function () { return fishbone_diagram_1.fishboneDiagram; } });
19
+ var flow_diagram_1 = require("./flow-diagram.js");
20
+ Object.defineProperty(exports, "flow-diagram", { enumerable: true, get: function () { return flow_diagram_1.flowDiagram; } });
21
+ var funnel_1 = require("./funnel.js");
22
+ Object.defineProperty(exports, "funnel", { enumerable: true, get: function () { return funnel_1.funnel; } });
23
+ var histogram_1 = require("./histogram.js");
24
+ Object.defineProperty(exports, "histogram", { enumerable: true, get: function () { return histogram_1.histogram; } });
25
+ var line_1 = require("./line.js");
26
+ Object.defineProperty(exports, "line", { enumerable: true, get: function () { return line_1.line; } });
27
+ var liquid_1 = require("./liquid.js");
28
+ Object.defineProperty(exports, "liquid", { enumerable: true, get: function () { return liquid_1.liquid; } });
29
+ var mind_map_1 = require("./mind-map.js");
30
+ Object.defineProperty(exports, "mind-map", { enumerable: true, get: function () { return mind_map_1.mindMap; } });
31
+ var network_graph_1 = require("./network-graph.js");
32
+ Object.defineProperty(exports, "network-graph", { enumerable: true, get: function () { return network_graph_1.networkGraph; } });
33
+ var organization_chart_1 = require("./organization-chart.js");
34
+ Object.defineProperty(exports, "organization-chart", { enumerable: true, get: function () { return organization_chart_1.organizationChart; } });
35
+ var pie_1 = require("./pie.js");
36
+ Object.defineProperty(exports, "pie", { enumerable: true, get: function () { return pie_1.pie; } });
37
+ var radar_1 = require("./radar.js");
38
+ Object.defineProperty(exports, "radar", { enumerable: true, get: function () { return radar_1.radar; } });
39
+ var sankey_1 = require("./sankey.js");
40
+ Object.defineProperty(exports, "sankey", { enumerable: true, get: function () { return sankey_1.sankey; } });
41
+ var scatter_1 = require("./scatter.js");
42
+ Object.defineProperty(exports, "scatter", { enumerable: true, get: function () { return scatter_1.scatter; } });
43
+ var treemap_1 = require("./treemap.js");
44
+ Object.defineProperty(exports, "treemap", { enumerable: true, get: function () { return treemap_1.treemap; } });
45
+ var venn_1 = require("./venn.js");
46
+ Object.defineProperty(exports, "venn", { enumerable: true, get: function () { return venn_1.venn; } });
47
+ var violin_1 = require("./violin.js");
48
+ Object.defineProperty(exports, "violin", { enumerable: true, get: function () { return violin_1.violin; } });
49
+ var waterfall_1 = require("./waterfall.js");
50
+ Object.defineProperty(exports, "waterfall", { enumerable: true, get: function () { return waterfall_1.waterfall; } });
51
+ var word_cloud_1 = require("./word-cloud.js");
52
+ Object.defineProperty(exports, "word-cloud", { enumerable: true, get: function () { return word_cloud_1.wordCloud; } });
@@ -0,0 +1,41 @@
1
+ import { z } from "zod";
2
+ export declare const line: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ time: z.ZodString;
6
+ value: z.ZodNumber;
7
+ group: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>>;
9
+ style: z.ZodOptional<z.ZodObject<{
10
+ backgroundColor: z.ZodOptional<z.ZodString>;
11
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13
+ default: "default";
14
+ rough: "rough";
15
+ }>>>;
16
+ startAtZero: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
17
+ lineWidth: z.ZodOptional<z.ZodNumber>;
18
+ }, z.core.$strip>>;
19
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
20
+ default: "default";
21
+ academy: "academy";
22
+ dark: "dark";
23
+ }>>>;
24
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
25
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
26
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
27
+ axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
28
+ axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
29
+ };
30
+ tool: {
31
+ name: string;
32
+ description: string;
33
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
34
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
35
+ }, z.core.$strip>>;
36
+ annotations: {
37
+ title: string;
38
+ readOnlyHint: boolean;
39
+ };
40
+ };
41
+ };
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.line = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ // Line chart data schema
8
+ const data = zod_1.z.object({
9
+ time: zod_1.z.string(),
10
+ value: zod_1.z.number(),
11
+ group: zod_1.z.string().optional(),
12
+ });
13
+ // Line chart input schema
14
+ const schema = {
15
+ data: zod_1.z
16
+ .array(data)
17
+ .describe("Data for line chart, it should be an array of objects, each object contains a `time` field and a `value` field, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }], when the data is grouped by time, the `group` field should be used to specify the group, such as, [{ time: '2015', value: 23, group: 'A' }, { time: '2015', value: 32, group: 'B' }].")
18
+ .nonempty({ message: "Line chart data cannot be empty." }),
19
+ style: zod_1.z
20
+ .object({
21
+ backgroundColor: base_1.BackgroundColorSchema,
22
+ palette: base_1.PaletteSchema,
23
+ texture: base_1.TextureSchema,
24
+ startAtZero: base_1.StartAtZeroSchema,
25
+ lineWidth: zod_1.z
26
+ .number()
27
+ .optional()
28
+ .describe("Line width for the lines of chart, such as 4."),
29
+ })
30
+ .optional()
31
+ .describe("Style configuration for the chart with a JSON object, optional."),
32
+ theme: base_1.ThemeSchema,
33
+ width: base_1.WidthSchema,
34
+ height: base_1.HeightSchema,
35
+ title: base_1.TitleSchema,
36
+ axisXTitle: base_1.AxisXTitleSchema,
37
+ axisYTitle: base_1.AxisYTitleSchema,
38
+ };
39
+ // Line chart tool descriptor
40
+ const tool = {
41
+ name: "generate_line_chart",
42
+ description: "Generate a line chart to show trends over time, such as, the ratio of Apple computer sales to Apple's profits changed from 2000 to 2016.",
43
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
44
+ annotations: {
45
+ title: "Generate Line Chart",
46
+ readOnlyHint: true,
47
+ },
48
+ };
49
+ exports.line = {
50
+ schema,
51
+ tool,
52
+ };
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ export declare const liquid: {
3
+ schema: {
4
+ percent: z.ZodNumber;
5
+ shape: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
6
+ rect: "rect";
7
+ circle: "circle";
8
+ pin: "pin";
9
+ triangle: "triangle";
10
+ }>>>;
11
+ style: z.ZodOptional<z.ZodObject<{
12
+ backgroundColor: z.ZodOptional<z.ZodString>;
13
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
14
+ default: "default";
15
+ rough: "rough";
16
+ }>>>;
17
+ color: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
19
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
20
+ default: "default";
21
+ academy: "academy";
22
+ dark: "dark";
23
+ }>>>;
24
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
25
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
26
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
27
+ };
28
+ tool: {
29
+ name: string;
30
+ description: string;
31
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
32
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
33
+ }, z.core.$strip>>;
34
+ annotations: {
35
+ title: string;
36
+ readOnlyHint: boolean;
37
+ };
38
+ };
39
+ };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.liquid = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ const schema = {
8
+ percent: zod_1.z
9
+ .number()
10
+ .describe("The percentage value to display in the liquid chart, should be a number between 0 and 1, where 1 represents 100%. For example, 0.75 represents 75%.")
11
+ .min(0, { message: "Value must be at least 0." })
12
+ .max(1, { message: "Value must be at most 1." }),
13
+ shape: zod_1.z
14
+ .enum(["circle", "rect", "pin", "triangle"])
15
+ .optional()
16
+ .default("circle")
17
+ .describe("The shape of the liquid chart, can be 'circle', 'rect', 'pin', or 'triangle'. Default is 'circle'."),
18
+ style: zod_1.z
19
+ .object({
20
+ backgroundColor: base_1.BackgroundColorSchema,
21
+ texture: base_1.TextureSchema,
22
+ color: zod_1.z
23
+ .string()
24
+ .optional()
25
+ .describe("Custom color for the liquid chart, if not specified, defaults to the theme color."),
26
+ })
27
+ .optional()
28
+ .describe("Style configuration for the chart with a JSON object, optional."),
29
+ theme: base_1.ThemeSchema,
30
+ width: base_1.WidthSchema,
31
+ height: base_1.HeightSchema,
32
+ title: base_1.TitleSchema,
33
+ };
34
+ const tool = {
35
+ name: "generate_liquid_chart",
36
+ description: "Generate a liquid chart to visualize a single value as a percentage, such as, the current occupancy rate of a reservoir or the completion percentage of a project.",
37
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
38
+ annotations: {
39
+ title: "Generate Liquid Chart",
40
+ readOnlyHint: true,
41
+ },
42
+ };
43
+ exports.liquid = {
44
+ schema,
45
+ tool,
46
+ };
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ export declare const mindMap: {
3
+ schema: {
4
+ data: z.ZodType<import("../utils/validator").TreeDataType, unknown, z.core.$ZodTypeInternals<import("../utils/validator").TreeDataType, unknown>>;
5
+ style: z.ZodOptional<z.ZodObject<{
6
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
7
+ default: "default";
8
+ rough: "rough";
9
+ }>>>;
10
+ }, z.core.$strip>>;
11
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
12
+ default: "default";
13
+ academy: "academy";
14
+ dark: "dark";
15
+ }>>>;
16
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
17
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
18
+ };
19
+ tool: {
20
+ name: string;
21
+ description: string;
22
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
23
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
24
+ }, z.core.$strip>>;
25
+ annotations: {
26
+ title: string;
27
+ readOnlyHint: boolean;
28
+ };
29
+ };
30
+ };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mindMap = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const validator_1 = require("../utils/validator.js");
7
+ const base_1 = require("./base.js");
8
+ const fishbone_diagram_1 = require("./fishbone-diagram.js");
9
+ // Mind map node schema
10
+ // The recursive schema is not supported by gemini, and other clients, so we use a non-recursive schema which can represent a tree structure with a fixed depth.
11
+ // Ref: https://github.com/antvis/mcp-server-chart/issues/155
12
+ // Ref: https://github.com/antvis/mcp-server-chart/issues/132
13
+ const MindMapNodeSchema = fishbone_diagram_1.FishboneNodeSchema;
14
+ // Mind map chart input schema
15
+ const schema = {
16
+ data: MindMapNodeSchema.describe("Data for mind map chart which is a hierarchical structure, such as, { name: 'main topic', children: [{ name: 'topic 1', children: [{ name:'subtopic 1-1' }] }, and the maximum depth is 3.").refine(validator_1.validatedTreeDataSchema, {
17
+ message: "Invalid parameters: node name is not unique.",
18
+ path: ["data"],
19
+ }),
20
+ style: zod_1.z
21
+ .object({
22
+ texture: base_1.TextureSchema,
23
+ })
24
+ .optional()
25
+ .describe("Style configuration for the chart with a JSON object, optional."),
26
+ theme: base_1.ThemeSchema,
27
+ width: base_1.WidthSchema,
28
+ height: base_1.HeightSchema,
29
+ };
30
+ // Mind map chart tool descriptor
31
+ const tool = {
32
+ name: "generate_mind_map",
33
+ description: "Generate a mind map chart to organizes and presents information in a hierarchical structure with branches radiating from a central topic, such as, a diagram showing the relationship between a main topic and its subtopics.",
34
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
35
+ annotations: {
36
+ title: "Generate Mind Map",
37
+ readOnlyHint: true,
38
+ },
39
+ };
40
+ exports.mindMap = {
41
+ schema,
42
+ tool,
43
+ };
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ export declare const networkGraph: {
3
+ schema: {
4
+ data: z.ZodObject<{
5
+ nodes: z.ZodArray<z.ZodObject<{
6
+ name: z.ZodString;
7
+ }, z.core.$strip>>;
8
+ edges: z.ZodArray<z.ZodObject<{
9
+ source: z.ZodString;
10
+ target: z.ZodString;
11
+ name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
12
+ }, z.core.$strip>>;
13
+ }, z.core.$strip>;
14
+ style: z.ZodOptional<z.ZodObject<{
15
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
16
+ default: "default";
17
+ rough: "rough";
18
+ }>>>;
19
+ }, z.core.$strip>>;
20
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
21
+ default: "default";
22
+ academy: "academy";
23
+ dark: "dark";
24
+ }>>>;
25
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
26
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
27
+ };
28
+ tool: {
29
+ name: string;
30
+ description: string;
31
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
32
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
33
+ }, z.core.$strip>>;
34
+ annotations: {
35
+ title: string;
36
+ readOnlyHint: boolean;
37
+ };
38
+ };
39
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.networkGraph = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const validator_1 = require("../utils/validator.js");
7
+ const base_1 = require("./base.js");
8
+ // Network graph input schema
9
+ const schema = {
10
+ data: zod_1.z
11
+ .object({
12
+ nodes: zod_1.z
13
+ .array(base_1.NodeSchema)
14
+ .nonempty({ message: "At least one node is required." }),
15
+ edges: zod_1.z.array(base_1.EdgeSchema),
16
+ })
17
+ .describe("Data for network graph chart, such as, { nodes: [{ name: 'node1' }, { name: 'node2' }], edges: [{ source: 'node1', target: 'node2', name: 'edge1' }] }")
18
+ .refine(validator_1.validatedNodeEdgeDataSchema, {
19
+ message: "Invalid parameters",
20
+ path: ["data", "edges"],
21
+ }),
22
+ style: zod_1.z
23
+ .object({
24
+ texture: base_1.TextureSchema,
25
+ })
26
+ .optional()
27
+ .describe("Style configuration for the chart with a JSON object, optional."),
28
+ theme: base_1.ThemeSchema,
29
+ width: base_1.WidthSchema,
30
+ height: base_1.HeightSchema,
31
+ };
32
+ // Network graph tool descriptor
33
+ const tool = {
34
+ name: "generate_network_graph",
35
+ description: "Generate a network graph chart to show relationships (edges) between entities (nodes), such as, relationships between people in social networks.",
36
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
37
+ annotations: {
38
+ title: "Generate Network Graph",
39
+ readOnlyHint: true,
40
+ },
41
+ };
42
+ exports.networkGraph = {
43
+ schema,
44
+ tool,
45
+ };
@@ -0,0 +1,49 @@
1
+ import { z } from "zod";
2
+ export declare const organizationChart: {
3
+ schema: {
4
+ data: z.ZodObject<{
5
+ name: z.ZodString;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ children: z.ZodOptional<z.ZodArray<z.ZodObject<{
8
+ name: z.ZodString;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ children: z.ZodOptional<z.ZodArray<z.ZodObject<{
11
+ name: z.ZodString;
12
+ description: z.ZodOptional<z.ZodString>;
13
+ children: z.ZodOptional<z.ZodArray<z.ZodObject<{
14
+ name: z.ZodString;
15
+ description: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>>>;
17
+ }, z.core.$strip>>>;
18
+ }, z.core.$strip>>>;
19
+ }, z.core.$strip>;
20
+ orient: z.ZodDefault<z.ZodEnum<{
21
+ horizontal: "horizontal";
22
+ vertical: "vertical";
23
+ }>>;
24
+ style: z.ZodOptional<z.ZodObject<{
25
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
26
+ default: "default";
27
+ rough: "rough";
28
+ }>>>;
29
+ }, z.core.$strip>>;
30
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
31
+ default: "default";
32
+ academy: "academy";
33
+ dark: "dark";
34
+ }>>>;
35
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
36
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
37
+ };
38
+ tool: {
39
+ name: string;
40
+ description: string;
41
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
42
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
43
+ }, z.core.$strip>>;
44
+ annotations: {
45
+ title: string;
46
+ readOnlyHint: boolean;
47
+ };
48
+ };
49
+ };
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.organizationChart = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ // The recursive schema is not supported by gemini, and other clients, so we use a non-recursive schema which can represent a tree structure with a fixed depth.
8
+ // Ref: https://github.com/antvis/mcp-server-chart/issues/155
9
+ // Ref: https://github.com/antvis/mcp-server-chart/issues/132
10
+ const OrganizationChartNodeSchema = zod_1.z.object({
11
+ name: zod_1.z.string(),
12
+ description: zod_1.z.string().optional(),
13
+ children: zod_1.z
14
+ .array(zod_1.z.object({
15
+ name: zod_1.z.string(),
16
+ description: zod_1.z.string().optional(),
17
+ children: zod_1.z
18
+ .array(zod_1.z.object({
19
+ name: zod_1.z.string(),
20
+ description: zod_1.z.string().optional(),
21
+ children: zod_1.z
22
+ .array(zod_1.z.object({
23
+ name: zod_1.z.string(),
24
+ description: zod_1.z.string().optional(),
25
+ }))
26
+ .optional(),
27
+ }))
28
+ .optional(),
29
+ }))
30
+ .optional(),
31
+ });
32
+ const schema = {
33
+ data: OrganizationChartNodeSchema.describe("Data for organization chart which is a hierarchical structure, such as, { name: 'CEO', description: 'Chief Executive Officer', children: [{ name: 'CTO', description: 'Chief Technology Officer', children: [{ name: 'Dev Manager', description: 'Development Manager' }] }] }, and the maximum depth is 3."),
34
+ orient: zod_1.z
35
+ .enum(["horizontal", "vertical"])
36
+ .default("vertical")
37
+ .describe("Orientation of the organization chart, either horizontal or vertical. Default is vertical, when the level of the chart is more than 3, it is recommended to use horizontal orientation."),
38
+ style: zod_1.z
39
+ .object({
40
+ texture: base_1.TextureSchema,
41
+ })
42
+ .optional()
43
+ .describe("Style configuration for the chart with a JSON object, optional."),
44
+ theme: base_1.ThemeSchema,
45
+ width: base_1.WidthSchema,
46
+ height: base_1.HeightSchema,
47
+ };
48
+ const tool = {
49
+ name: "generate_organization_chart",
50
+ description: "Generate an organization chart to visualize the hierarchical structure of an organization, such as, a diagram showing the relationship between a CEO and their direct reports.",
51
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
52
+ annotations: {
53
+ title: "Generate Organization Chart",
54
+ readOnlyHint: true,
55
+ },
56
+ };
57
+ exports.organizationChart = {
58
+ schema,
59
+ tool,
60
+ };
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ export declare const pie: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ category: z.ZodString;
6
+ value: z.ZodNumber;
7
+ }, z.core.$strip>>;
8
+ innerRadius: z.ZodDefault<z.ZodNumber>;
9
+ style: z.ZodOptional<z.ZodObject<{
10
+ backgroundColor: z.ZodOptional<z.ZodString>;
11
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13
+ default: "default";
14
+ rough: "rough";
15
+ }>>>;
16
+ }, z.core.$strip>>;
17
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
18
+ default: "default";
19
+ academy: "academy";
20
+ dark: "dark";
21
+ }>>>;
22
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
23
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
24
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
25
+ };
26
+ tool: {
27
+ name: string;
28
+ description: string;
29
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
30
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
31
+ }, z.core.$strip>>;
32
+ annotations: {
33
+ title: string;
34
+ readOnlyHint: boolean;
35
+ };
36
+ };
37
+ };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pie = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ // Pie chart data schema
8
+ const data = zod_1.z.object({
9
+ category: zod_1.z.string(),
10
+ value: zod_1.z.number(),
11
+ });
12
+ // Pie chart input schema
13
+ const schema = {
14
+ data: zod_1.z
15
+ .array(data)
16
+ .describe("Data for pie chart, it should be an array of objects, each object contains a `category` field and a `value` field, such as, [{ category: '分类一', value: 27 }].")
17
+ .nonempty({ message: "Pie chart data cannot be empty." }),
18
+ innerRadius: zod_1.z
19
+ .number()
20
+ .default(0)
21
+ .describe("Set the innerRadius of pie chart, the value between 0 and 1. Set the pie chart as a donut chart. Set the value to 0.6 or number in [0 ,1] to enable it."),
22
+ style: zod_1.z
23
+ .object({
24
+ backgroundColor: base_1.BackgroundColorSchema,
25
+ palette: base_1.PaletteSchema,
26
+ texture: base_1.TextureSchema,
27
+ })
28
+ .optional()
29
+ .describe("Style configuration for the chart with a JSON object, optional."),
30
+ theme: base_1.ThemeSchema,
31
+ width: base_1.WidthSchema,
32
+ height: base_1.HeightSchema,
33
+ title: base_1.TitleSchema,
34
+ };
35
+ // Pie chart tool descriptor
36
+ const tool = {
37
+ name: "generate_pie_chart",
38
+ description: "Generate a pie chart to show the proportion of parts, such as, market share and budget allocation.",
39
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
40
+ annotations: {
41
+ title: "Generate Pie Chart",
42
+ readOnlyHint: true,
43
+ },
44
+ };
45
+ exports.pie = {
46
+ schema,
47
+ tool,
48
+ };
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ export declare const radar: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ name: z.ZodString;
6
+ value: z.ZodNumber;
7
+ group: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>>;
9
+ style: z.ZodOptional<z.ZodObject<{
10
+ backgroundColor: z.ZodOptional<z.ZodString>;
11
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13
+ default: "default";
14
+ rough: "rough";
15
+ }>>>;
16
+ lineWidth: z.ZodOptional<z.ZodNumber>;
17
+ }, z.core.$strip>>;
18
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
19
+ default: "default";
20
+ academy: "academy";
21
+ dark: "dark";
22
+ }>>>;
23
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
24
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
25
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
26
+ };
27
+ tool: {
28
+ name: string;
29
+ description: string;
30
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
31
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
32
+ }, z.core.$strip>>;
33
+ annotations: {
34
+ title: string;
35
+ readOnlyHint: boolean;
36
+ };
37
+ };
38
+ };