Compare commits

...

1 Commits

Author SHA1 Message Date
dayuan.jiang
9ea48a8426 fix: improve create_new_diagram tool description to prevent misuse and bump to v0.2.0 2026-04-10 17:11:10 +09:00
4 changed files with 16 additions and 12 deletions

View File

@@ -1,12 +1,12 @@
{ {
"name": "@next-ai-drawio/mcp-server", "name": "@next-ai-drawio/mcp-server",
"version": "0.1.17", "version": "0.2.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@next-ai-drawio/mcp-server", "name": "@next-ai-drawio/mcp-server",
"version": "0.1.17", "version": "0.2.0",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.0.4", "@modelcontextprotocol/sdk": "^1.0.4",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@next-ai-drawio/mcp-server", "name": "@next-ai-drawio/mcp-server",
"version": "0.1.19", "version": "0.2.0",
"description": "MCP server for Next AI Draw.io - AI-powered diagram generation with real-time browser preview", "description": "MCP server for Next AI Draw.io - AI-powered diagram generation with real-time browser preview",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",

View File

@@ -155,19 +155,22 @@ server.registerTool(
server.registerTool( server.registerTool(
"create_new_diagram", "create_new_diagram",
{ {
description: `Create a NEW diagram from mxGraphModel XML. Use this when creating a diagram from scratch or replacing the current diagram entirely. description: `Create a NEW diagram from mxGraphModel XML. ONLY use this when creating a diagram from scratch.
⚠️ DO NOT use this tool to modify an existing diagram — it will DESTROY all existing content and user changes. Use edit_diagram instead for ANY modifications to an existing diagram.
CRITICAL: You MUST provide the 'xml' argument in EVERY call. Do NOT call this tool without xml. CRITICAL: You MUST provide the 'xml' argument in EVERY call. Do NOT call this tool without xml.
When to use this tool: When to use this tool:
- Creating a new diagram from scratch - Creating a new diagram from scratch (no existing diagram)
- Replacing the current diagram with a completely different one - The user explicitly asks to "start over" or "create a new diagram"
- Major structural changes that require regenerating the diagram
When to use edit_diagram instead: When to use edit_diagram instead (ALWAYS prefer edit_diagram if a diagram already exists):
- Small modifications to existing diagram - ANY modifications to an existing diagram
- Adding/removing individual elements - Adding/removing/moving elements
- Changing labels, colors, or positions - Changing labels, colors, styles, or positions
- Restructuring or reorganizing existing content
- Adding new elements to an existing diagram
XML FORMAT - Full mxGraphModel structure: XML FORMAT - Full mxGraphModel structure:
<mxGraphModel> <mxGraphModel>

View File

@@ -12,7 +12,8 @@
"declaration": true, "declaration": true,
"declarationMap": true, "declarationMap": true,
"sourceMap": true, "sourceMap": true,
"resolveJsonModule": true "resolveJsonModule": true,
"types": ["node"]
}, },
"include": ["src/**/*"], "include": ["src/**/*"],
"exclude": ["node_modules", "dist"] "exclude": ["node_modules", "dist"]