Skip to content

Commit c72f55d

Browse files
authored
feat:fixed charts schema description (#70)
* feat: fix chart schema des * feat: version update
1 parent 3c12a5a commit c72f55d

File tree

8 files changed

+15
-9
lines changed

8 files changed

+15
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A Model Context Protocol server for generating charts using [AntV](https://githu
66
<img width="380" src="https://glama.ai/mcp/servers/@antvis/mcp-server-chart/badge" />
77
</a>
88

9-
This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools. You can also it use in [Dify](https://marketplace.dify.ai/plugins/antv/visualization).
9+
This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools. You can also use it in [Dify](https://marketplace.dify.ai/plugins/antv/visualization).
1010

1111

1212
## ✨ Features

__tests__/charts/column.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"required": ["category", "value"]
1919
},
20-
"description": "Data for column chart, such as, [{ category: '北京' value: 825; group: '油车' }]."
20+
"description": "Data for column chart, such as, [{ category: '北京', value: 825, group: '油车' }]."
2121
},
2222
"group": {
2323
"type": "boolean",

__tests__/charts/dual-axes.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@
6060
"axisYTitle": {
6161
"type": "string",
6262
"default": "",
63-
"description": "Set the y-axis title of the chart series."
63+
"description": "Set the y-axis title of the chart series, such as, axisYTitle: '销售额'."
6464
}
6565
},
6666
"required": ["type", "data"]
67-
}
67+
},
68+
"description": "Series for dual axes chart, such as, [{ type: 'column', data: [91.9, 99.1, 101.6, 114.4, 121],axisYTitle: '销售额' }, { type: 'line', data: [0.055, 0.06, 0.062, 0.07, 0.075], 'axisYTitle': '利润率' }]."
6869
}
6970
},
7071
"required": ["categories", "series"]

__tests__/charts/word-cloud.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"required": ["text", "value"]
1818
},
19-
"description": "Data for word cloud chart, such as, [{ value: '4.272', text: '形成' }]."
19+
"description": "Data for word cloud chart, such as, [{ value: 4.272, text: '形成' }]."
2020
},
2121
"theme": {
2222
"default": "default",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@antv/mcp-server-chart",
33
"description": "A Model Context Protocol server for generating charts using AntV, This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools.",
4-
"version": "0.4.0",
4+
"version": "0.4.1",
55
"main": "build/index.js",
66
"type": "module",
77
"scripts": {

src/charts/column.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const schema = z.object({
2121
data: z
2222
.array(data)
2323
.describe(
24-
"Data for column chart, such as, [{ category: '北京' value: 825; group: '油车' }].",
24+
"Data for column chart, such as, [{ category: '北京', value: 825, group: '油车' }].",
2525
)
2626
.nonempty({ message: "Column chart data cannot be empty." }),
2727
group: z

src/charts/dual-axes.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const DualAxesSeriesSchema = z.object({
2121
axisYTitle: z
2222
.string()
2323
.default("")
24-
.describe("Set the y-axis title of the chart series.")
24+
.describe(
25+
"Set the y-axis title of the chart series, such as, axisYTitle: '销售额'.",
26+
)
2527
.optional(),
2628
});
2729

@@ -35,6 +37,9 @@ const schema = z.object({
3537
.nonempty({ message: "Dual axes chart categories cannot be empty." }),
3638
series: z
3739
.array(DualAxesSeriesSchema)
40+
.describe(
41+
"Series for dual axes chart, such as, [{ type: 'column', data: [91.9, 99.1, 101.6, 114.4, 121],axisYTitle: '销售额' }, { type: 'line', data: [0.055, 0.06, 0.062, 0.07, 0.075], 'axisYTitle': '利润率' }].",
42+
)
3843
.nonempty({ message: "Dual axes chart series cannot be empty." }),
3944
theme: ThemeSchema,
4045
width: WidthSchema,

src/charts/word-cloud.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const schema = z.object({
1313
data: z
1414
.array(data)
1515
.describe(
16-
"Data for word cloud chart, such as, [{ value: '4.272', text: '形成' }].",
16+
"Data for word cloud chart, such as, [{ value: 4.272, text: '形成' }].",
1717
)
1818
.nonempty({ message: "Word cloud chart data cannot be empty." }),
1919
theme: ThemeSchema,

0 commit comments

Comments
 (0)