@umengfe/mcp-server-chart 0.0.1
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/LICENSE +21 -0
- package/README.md +273 -0
- package/build/charts/area.d.ts +51 -0
- package/build/charts/area.js +52 -0
- package/build/charts/bar.d.ts +49 -0
- package/build/charts/bar.js +53 -0
- package/build/charts/base.d.ts +34 -0
- package/build/charts/base.js +74 -0
- package/build/charts/boxplot.d.ts +47 -0
- package/build/charts/boxplot.js +45 -0
- package/build/charts/column.d.ts +49 -0
- package/build/charts/column.js +53 -0
- package/build/charts/district-map.d.ts +93 -0
- package/build/charts/district-map.js +85 -0
- package/build/charts/dual-axes.d.ts +47 -0
- package/build/charts/dual-axes.js +54 -0
- package/build/charts/fishbone-diagram.d.ts +28 -0
- package/build/charts/fishbone-diagram.js +55 -0
- package/build/charts/flow-diagram.d.ts +91 -0
- package/build/charts/flow-diagram.js +41 -0
- package/build/charts/funnel.d.ts +42 -0
- package/build/charts/funnel.js +37 -0
- package/build/charts/histogram.d.ts +36 -0
- package/build/charts/histogram.js +41 -0
- package/build/charts/index.d.ts +28 -0
- package/build/charts/index.js +56 -0
- package/build/charts/line.d.ts +50 -0
- package/build/charts/line.js +47 -0
- package/build/charts/liquid.d.ts +34 -0
- package/build/charts/liquid.js +42 -0
- package/build/charts/mind-map.d.ts +26 -0
- package/build/charts/mind-map.js +39 -0
- package/build/charts/network-graph.d.ts +91 -0
- package/build/charts/network-graph.js +41 -0
- package/build/charts/organization-chart.d.ts +114 -0
- package/build/charts/organization-chart.js +56 -0
- package/build/charts/path-map.d.ts +25 -0
- package/build/charts/path-map.js +25 -0
- package/build/charts/pie.d.ts +43 -0
- package/build/charts/pie.js +44 -0
- package/build/charts/pin-map.d.ts +35 -0
- package/build/charts/pin-map.js +34 -0
- package/build/charts/radar.d.ts +48 -0
- package/build/charts/radar.js +45 -0
- package/build/charts/sankey.d.ts +46 -0
- package/build/charts/sankey.js +43 -0
- package/build/charts/scatter.d.ts +47 -0
- package/build/charts/scatter.js +43 -0
- package/build/charts/treemap.d.ts +86 -0
- package/build/charts/treemap.js +55 -0
- package/build/charts/venn.d.ts +45 -0
- package/build/charts/venn.js +45 -0
- package/build/charts/violin.d.ts +47 -0
- package/build/charts/violin.js +45 -0
- package/build/charts/word-cloud.d.ts +42 -0
- package/build/charts/word-cloud.js +40 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +73 -0
- package/build/sdk.d.ts +6 -0
- package/build/sdk.js +24 -0
- package/build/server.d.ts +17 -0
- package/build/server.js +132 -0
- package/build/services/index.d.ts +3 -0
- package/build/services/index.js +9 -0
- package/build/services/sse.d.ts +2 -0
- package/build/services/sse.js +58 -0
- package/build/services/stdio.d.ts +2 -0
- package/build/services/stdio.js +21 -0
- package/build/services/streamable.d.ts +2 -0
- package/build/services/streamable.js +58 -0
- package/build/utils/callTool.d.ts +18 -0
- package/build/utils/callTool.js +130 -0
- package/build/utils/env.d.ts +12 -0
- package/build/utils/env.js +32 -0
- package/build/utils/generate.d.ts +25 -0
- package/build/utils/generate.js +68 -0
- package/build/utils/index.d.ts +3 -0
- package/build/utils/index.js +9 -0
- package/build/utils/logger.d.ts +28 -0
- package/build/utils/logger.js +57 -0
- package/build/utils/schema.d.ts +7 -0
- package/build/utils/schema.js +14 -0
- package/build/utils/validator.d.ts +34 -0
- package/build/utils/validator.js +76 -0
- package/package.json +65 -0
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
name: string;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
}>, "many">>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
children?: {
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
children?: {
|
|
34
|
+
name: string;
|
|
35
|
+
description?: string | undefined;
|
|
36
|
+
}[] | undefined;
|
|
37
|
+
}>, "many">>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
name: string;
|
|
40
|
+
description?: string | undefined;
|
|
41
|
+
children?: {
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string | undefined;
|
|
44
|
+
children?: {
|
|
45
|
+
name: string;
|
|
46
|
+
description?: string | undefined;
|
|
47
|
+
}[] | undefined;
|
|
48
|
+
}[] | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
name: string;
|
|
51
|
+
description?: string | undefined;
|
|
52
|
+
children?: {
|
|
53
|
+
name: string;
|
|
54
|
+
description?: string | undefined;
|
|
55
|
+
children?: {
|
|
56
|
+
name: string;
|
|
57
|
+
description?: string | undefined;
|
|
58
|
+
}[] | undefined;
|
|
59
|
+
}[] | undefined;
|
|
60
|
+
}>, "many">>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
name: string;
|
|
63
|
+
description?: string | undefined;
|
|
64
|
+
children?: {
|
|
65
|
+
name: string;
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
children?: {
|
|
68
|
+
name: string;
|
|
69
|
+
description?: string | undefined;
|
|
70
|
+
children?: {
|
|
71
|
+
name: string;
|
|
72
|
+
description?: string | undefined;
|
|
73
|
+
}[] | undefined;
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
}[] | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
name: string;
|
|
78
|
+
description?: string | undefined;
|
|
79
|
+
children?: {
|
|
80
|
+
name: string;
|
|
81
|
+
description?: string | undefined;
|
|
82
|
+
children?: {
|
|
83
|
+
name: string;
|
|
84
|
+
description?: string | undefined;
|
|
85
|
+
children?: {
|
|
86
|
+
name: string;
|
|
87
|
+
description?: string | undefined;
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
}[] | undefined;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
orient: z.ZodDefault<z.ZodEnum<["horizontal", "vertical"]>>;
|
|
93
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
texture: "default" | "rough";
|
|
97
|
+
}, {
|
|
98
|
+
texture?: "default" | "rough" | undefined;
|
|
99
|
+
}>>;
|
|
100
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
101
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
102
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
103
|
+
};
|
|
104
|
+
tool: {
|
|
105
|
+
name: string;
|
|
106
|
+
description: string;
|
|
107
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
108
|
+
$schema?: string | undefined;
|
|
109
|
+
definitions?: {
|
|
110
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
111
|
+
} | undefined;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
};
|
|
53
|
+
exports.organizationChart = {
|
|
54
|
+
schema,
|
|
55
|
+
tool,
|
|
56
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const pathMap: {
|
|
3
|
+
schema: {
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
data: z.ZodArray<z.ZodObject<{
|
|
6
|
+
data: z.ZodArray<z.ZodString, "atleastone">;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
data: [string, ...string[]];
|
|
9
|
+
}, {
|
|
10
|
+
data: [string, ...string[]];
|
|
11
|
+
}>, "atleastone">;
|
|
12
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
13
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
14
|
+
};
|
|
15
|
+
tool: {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
19
|
+
$schema?: string | undefined;
|
|
20
|
+
definitions?: {
|
|
21
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
22
|
+
} | undefined;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pathMap = 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
|
+
title: base_1.MapTitleSchema,
|
|
9
|
+
data: zod_1.z
|
|
10
|
+
.array(zod_1.z.object({ data: base_1.POIsSchema }).describe("The route and places along it."))
|
|
11
|
+
.nonempty("At least one route is required.")
|
|
12
|
+
.describe('Routes, each group represents all POIs along a route. For example, [{ "data": ["西安钟楼", "西安大唐不夜城", "西安大雁塔"] }, { "data": ["西安曲江池公园", "西安回民街"] }]'),
|
|
13
|
+
width: base_1.MapWidthSchema,
|
|
14
|
+
height: base_1.MapHeightSchema,
|
|
15
|
+
};
|
|
16
|
+
// https://modelcontextprotocol.io/specification/2025-03-26/server/tools#listing-tools
|
|
17
|
+
const tool = {
|
|
18
|
+
name: "generate_path_map",
|
|
19
|
+
description: "Generate a route map to display the user's planned route, such as travel guide routes.",
|
|
20
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
21
|
+
};
|
|
22
|
+
exports.pathMap = {
|
|
23
|
+
schema,
|
|
24
|
+
tool,
|
|
25
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
value: number;
|
|
9
|
+
category: string;
|
|
10
|
+
}, {
|
|
11
|
+
value: number;
|
|
12
|
+
category: string;
|
|
13
|
+
}>, "atleastone">;
|
|
14
|
+
innerRadius: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
16
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
17
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
texture: "default" | "rough";
|
|
21
|
+
backgroundColor?: string | undefined;
|
|
22
|
+
palette?: string[] | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
backgroundColor?: string | undefined;
|
|
25
|
+
palette?: string[] | undefined;
|
|
26
|
+
texture?: "default" | "rough" | undefined;
|
|
27
|
+
}>>;
|
|
28
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
29
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
30
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
31
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
32
|
+
};
|
|
33
|
+
tool: {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
37
|
+
$schema?: string | undefined;
|
|
38
|
+
definitions?: {
|
|
39
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
};
|
|
41
|
+
exports.pie = {
|
|
42
|
+
schema,
|
|
43
|
+
tool,
|
|
44
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const pinMap: {
|
|
3
|
+
schema: {
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
data: z.ZodArray<z.ZodString, "atleastone">;
|
|
6
|
+
markerPopup: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
type: z.ZodDefault<z.ZodString>;
|
|
8
|
+
width: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
height: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
borderRadius: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
type: string;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
borderRadius: number;
|
|
16
|
+
}, {
|
|
17
|
+
type?: string | undefined;
|
|
18
|
+
width?: number | undefined;
|
|
19
|
+
height?: number | undefined;
|
|
20
|
+
borderRadius?: number | undefined;
|
|
21
|
+
}>>;
|
|
22
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
23
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
24
|
+
};
|
|
25
|
+
tool: {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
29
|
+
$schema?: string | undefined;
|
|
30
|
+
definitions?: {
|
|
31
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
32
|
+
} | undefined;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pinMap = 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
|
+
title: base_1.MapTitleSchema,
|
|
9
|
+
data: base_1.POIsSchema,
|
|
10
|
+
markerPopup: zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
type: zod_1.z.string().default("image").describe('Must be "image".'),
|
|
13
|
+
width: zod_1.z.number().default(40).describe("Width of the photo."),
|
|
14
|
+
height: zod_1.z.number().default(40).describe("Height of the photo."),
|
|
15
|
+
borderRadius: zod_1.z
|
|
16
|
+
.number()
|
|
17
|
+
.default(8)
|
|
18
|
+
.describe("Border radius of the photo."),
|
|
19
|
+
})
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Marker type, one is simple mode, which is just an icon and does not require `markerPopup` configuration; the other is image mode, which displays location photos and requires `markerPopup` configuration. Among them, `width`/`height`/`borderRadius` can be combined to realize rectangular photos and square photos. In addition, when `borderRadius` is half of the width and height, it can also be a circular photo."),
|
|
22
|
+
width: base_1.MapWidthSchema,
|
|
23
|
+
height: base_1.MapHeightSchema,
|
|
24
|
+
};
|
|
25
|
+
// https://modelcontextprotocol.io/specification/2025-03-26/server/tools#listing-tools
|
|
26
|
+
const tool = {
|
|
27
|
+
name: "generate_pin_map",
|
|
28
|
+
description: "Generate a point map to display the location and distribution of point data on the map, such as the location distribution of attractions, hospitals, supermarkets, etc.",
|
|
29
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
30
|
+
};
|
|
31
|
+
exports.pinMap = {
|
|
32
|
+
schema,
|
|
33
|
+
tool,
|
|
34
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
value: number;
|
|
10
|
+
name: string;
|
|
11
|
+
group?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
value: number;
|
|
14
|
+
name: string;
|
|
15
|
+
group?: string | undefined;
|
|
16
|
+
}>, "atleastone">;
|
|
17
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
19
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
21
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
texture: "default" | "rough";
|
|
24
|
+
backgroundColor?: string | undefined;
|
|
25
|
+
palette?: string[] | undefined;
|
|
26
|
+
lineWidth?: number | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
backgroundColor?: string | undefined;
|
|
29
|
+
palette?: string[] | undefined;
|
|
30
|
+
texture?: "default" | "rough" | undefined;
|
|
31
|
+
lineWidth?: number | undefined;
|
|
32
|
+
}>>;
|
|
33
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
34
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
35
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
36
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
37
|
+
};
|
|
38
|
+
tool: {
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
42
|
+
$schema?: string | undefined;
|
|
43
|
+
definitions?: {
|
|
44
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
45
|
+
} | undefined;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.radar = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
// Radar chart data schema
|
|
8
|
+
const data = zod_1.z.object({
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
value: zod_1.z.number(),
|
|
11
|
+
group: zod_1.z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
// Radar chart input schema
|
|
14
|
+
const schema = {
|
|
15
|
+
data: zod_1.z
|
|
16
|
+
.array(data)
|
|
17
|
+
.describe("Data for radar chart, it should be an array of objects, each object contains a `name` field and a `value` field, such as, [{ name: 'Design', value: 70 }].")
|
|
18
|
+
.nonempty({ message: "Radar 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
|
+
lineWidth: zod_1.z
|
|
25
|
+
.number()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Line width for the lines of chart, such as 4."),
|
|
28
|
+
})
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
31
|
+
theme: base_1.ThemeSchema,
|
|
32
|
+
width: base_1.WidthSchema,
|
|
33
|
+
height: base_1.HeightSchema,
|
|
34
|
+
title: base_1.TitleSchema,
|
|
35
|
+
};
|
|
36
|
+
// Radar chart tool descriptor
|
|
37
|
+
const tool = {
|
|
38
|
+
name: "generate_radar_chart",
|
|
39
|
+
description: "Generate a radar chart to display multidimensional data (four dimensions or more), such as, evaluate Huawei and Apple phones in terms of five dimensions: ease of use, functionality, camera, benchmark scores, and battery life.",
|
|
40
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
41
|
+
};
|
|
42
|
+
exports.radar = {
|
|
43
|
+
schema,
|
|
44
|
+
tool,
|
|
45
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const sankey: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodArray<z.ZodObject<{
|
|
5
|
+
source: z.ZodString;
|
|
6
|
+
target: z.ZodString;
|
|
7
|
+
value: z.ZodNumber;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
value: number;
|
|
10
|
+
target: string;
|
|
11
|
+
source: string;
|
|
12
|
+
}, {
|
|
13
|
+
value: number;
|
|
14
|
+
target: string;
|
|
15
|
+
source: string;
|
|
16
|
+
}>, "atleastone">;
|
|
17
|
+
nodeAlign: z.ZodDefault<z.ZodOptional<z.ZodEnum<["left", "right", "justify", "center"]>>>;
|
|
18
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
20
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
texture: "default" | "rough";
|
|
24
|
+
backgroundColor?: string | undefined;
|
|
25
|
+
palette?: string[] | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
backgroundColor?: string | undefined;
|
|
28
|
+
palette?: string[] | undefined;
|
|
29
|
+
texture?: "default" | "rough" | undefined;
|
|
30
|
+
}>>;
|
|
31
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
32
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
33
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
34
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
35
|
+
};
|
|
36
|
+
tool: {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
40
|
+
$schema?: string | undefined;
|
|
41
|
+
definitions?: {
|
|
42
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
43
|
+
} | undefined;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sankey = 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 data = zod_1.z.object({
|
|
8
|
+
source: zod_1.z.string(),
|
|
9
|
+
target: zod_1.z.string(),
|
|
10
|
+
value: zod_1.z.number(),
|
|
11
|
+
});
|
|
12
|
+
const schema = {
|
|
13
|
+
data: zod_1.z
|
|
14
|
+
.array(data)
|
|
15
|
+
.describe("Date for sankey chart, such as, [{ source: 'Landing Page', target: 'Product Page', value: 50000 }, { source: 'Product Page', target: 'Add to Cart', value: 35000 }, { source: 'Add to Cart', target: 'Checkout', value: 25000 }, { source: 'Checkout', target: 'Payment', value: 15000 }, { source: 'Payment', target: 'Purchase Completed', value: 8000 }].")
|
|
16
|
+
.nonempty({ message: "Sankey chart data cannot be empty." }),
|
|
17
|
+
nodeAlign: zod_1.z
|
|
18
|
+
.enum(["left", "right", "justify", "center"])
|
|
19
|
+
.optional()
|
|
20
|
+
.default("center")
|
|
21
|
+
.describe("Alignment of nodes in the sankey chart, such as, 'left', 'right', 'justify', or 'center'."),
|
|
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
|
+
const tool = {
|
|
36
|
+
name: "generate_sankey_chart",
|
|
37
|
+
description: "Generate a sankey chart to visualize the flow of data between different stages or categories, such as, the user journey from landing on a page to completing a purchase.",
|
|
38
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
39
|
+
};
|
|
40
|
+
exports.sankey = {
|
|
41
|
+
schema,
|
|
42
|
+
tool,
|
|
43
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const scatter: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodArray<z.ZodObject<{
|
|
5
|
+
x: z.ZodNumber;
|
|
6
|
+
y: z.ZodNumber;
|
|
7
|
+
group: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
group?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
group?: string | undefined;
|
|
16
|
+
}>, "atleastone">;
|
|
17
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
19
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
texture: "default" | "rough";
|
|
23
|
+
backgroundColor?: string | undefined;
|
|
24
|
+
palette?: string[] | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
backgroundColor?: string | undefined;
|
|
27
|
+
palette?: string[] | undefined;
|
|
28
|
+
texture?: "default" | "rough" | undefined;
|
|
29
|
+
}>>;
|
|
30
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
31
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
32
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
33
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
34
|
+
axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
35
|
+
axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
36
|
+
};
|
|
37
|
+
tool: {
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
41
|
+
$schema?: string | undefined;
|
|
42
|
+
definitions?: {
|
|
43
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
44
|
+
} | undefined;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scatter = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
// Scatter chart data schema
|
|
8
|
+
const data = zod_1.z.object({
|
|
9
|
+
x: zod_1.z.number(),
|
|
10
|
+
y: zod_1.z.number(),
|
|
11
|
+
group: zod_1.z.string().optional().describe("Group name for the data point."),
|
|
12
|
+
});
|
|
13
|
+
// Scatter chart input schema
|
|
14
|
+
const schema = {
|
|
15
|
+
data: zod_1.z
|
|
16
|
+
.array(data)
|
|
17
|
+
.describe("Data for scatter chart, such as, [{ x: 10, y: 15 }].")
|
|
18
|
+
.nonempty({ message: "Scatter 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
|
+
})
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
27
|
+
theme: base_1.ThemeSchema,
|
|
28
|
+
width: base_1.WidthSchema,
|
|
29
|
+
height: base_1.HeightSchema,
|
|
30
|
+
title: base_1.TitleSchema,
|
|
31
|
+
axisXTitle: base_1.AxisXTitleSchema,
|
|
32
|
+
axisYTitle: base_1.AxisYTitleSchema,
|
|
33
|
+
};
|
|
34
|
+
// Scatter chart tool descriptor
|
|
35
|
+
const tool = {
|
|
36
|
+
name: "generate_scatter_chart",
|
|
37
|
+
description: "Generate a scatter chart to show the relationship between two variables, helps discover their relationship or trends, such as, the strength of correlation, data distribution patterns.",
|
|
38
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
39
|
+
};
|
|
40
|
+
exports.scatter = {
|
|
41
|
+
schema,
|
|
42
|
+
tool,
|
|
43
|
+
};
|