@z_ai/mcp-server 0.1.1-beta.0 → 0.1.1-beta.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/build/tools/data-viz.js +6 -1
- package/build/tools/diagram-analysis.js +6 -1
- package/build/tools/error-diagnosis.js +6 -1
- package/build/tools/general-image.js +6 -1
- package/build/tools/text-extraction.js +6 -1
- package/build/tools/ui-diff.js +6 -1
- package/build/tools/ui-to-artifact.js +9 -1
- package/build/tools/video-analysis.js +10 -1
- package/package.json +1 -1
package/build/tools/data-viz.js
CHANGED
|
@@ -41,7 +41,12 @@ class DataVizAnalysisService extends BaseImageAnalysisService {
|
|
|
41
41
|
export function registerDataVizAnalysisTool(server) {
|
|
42
42
|
const service = new DataVizAnalysisService();
|
|
43
43
|
const retryableAnalyze = withRetry(service.analyzeDataViz.bind(service), 2, 1000);
|
|
44
|
-
server.tool('analyze_data_visualization',
|
|
44
|
+
server.tool('analyze_data_visualization', `Analyze data visualizations, charts, graphs, and dashboards to extract insights and trends.
|
|
45
|
+
|
|
46
|
+
Use this tool ONLY when the user has a data visualization image and wants to understand the data patterns or metrics.
|
|
47
|
+
This tool specializes in interpreting visual data representations.
|
|
48
|
+
|
|
49
|
+
Do NOT use for: UI mockups, error messages, or technical architecture diagrams.`, {
|
|
45
50
|
image_source: z.string().describe('Local file path or remote URL to the image'),
|
|
46
51
|
prompt: z.string().describe('What insights or information you want to extract from this visualization.'),
|
|
47
52
|
analysis_focus: z.string().optional().describe('Optional: specify what to focus on (e.g., \'trends\', \'anomalies\', \'comparisons\', \'performance metrics\'). Leave empty for comprehensive analysis.')
|
|
@@ -41,7 +41,12 @@ class DiagramAnalysisService extends BaseImageAnalysisService {
|
|
|
41
41
|
export function registerDiagramAnalysisTool(server) {
|
|
42
42
|
const service = new DiagramAnalysisService();
|
|
43
43
|
const retryableAnalyze = withRetry(service.analyzeDiagram.bind(service), 2, 1000);
|
|
44
|
-
server.tool('understand_technical_diagram',
|
|
44
|
+
server.tool('understand_technical_diagram', `Analyze and explain technical diagrams including architecture diagrams, flowcharts, UML, ER diagrams, and system design diagrams.
|
|
45
|
+
|
|
46
|
+
Use this tool ONLY when the user has a technical diagram and wants to understand its structure or components.
|
|
47
|
+
This tool specializes in interpreting visual technical documentation.
|
|
48
|
+
|
|
49
|
+
Do NOT use for: UI screenshots, error messages, or data visualizations/charts.`, {
|
|
45
50
|
image_source: z.string().describe('Local file path or remote URL to the image'),
|
|
46
51
|
prompt: z.string().describe('What you want to understand or extract from this diagram.'),
|
|
47
52
|
diagram_type: z.string().optional().describe('Optional: specify the diagram type if known (e.g., \'architecture\', \'flowchart\', \'uml\', \'er-diagram\', \'sequence\'). Leave empty for auto-detection.')
|
|
@@ -41,7 +41,12 @@ class ErrorDiagnosisService extends BaseImageAnalysisService {
|
|
|
41
41
|
export function registerErrorDiagnosisTool(server) {
|
|
42
42
|
const service = new ErrorDiagnosisService();
|
|
43
43
|
const retryableDiagnose = withRetry(service.diagnoseError.bind(service), 2, 1000);
|
|
44
|
-
server.tool('diagnose_error_screenshot',
|
|
44
|
+
server.tool('diagnose_error_screenshot', `Diagnose and analyze error messages, stack traces, and exception screenshots.
|
|
45
|
+
|
|
46
|
+
Use this tool ONLY when the user has an error screenshot and needs help understanding or fixing it.
|
|
47
|
+
This tool specializes in error analysis and provides actionable solutions.
|
|
48
|
+
|
|
49
|
+
Do NOT use for: code extraction, UI analysis, or diagram understanding.`, {
|
|
45
50
|
image_source: z.string().describe('Local file path or remote URL to the image'),
|
|
46
51
|
prompt: z.string().describe('Description of what you need help with regarding this error. Include any relevant context about when it occurred.'),
|
|
47
52
|
context: z.string().optional().describe('Optional: additional context about when the error occurred (e.g., \'during npm install\', \'when running the app\', \'after deployment\'). Helps with more accurate diagnosis.')
|
|
@@ -34,7 +34,12 @@ class GeneralImageAnalysisService extends BaseImageAnalysisService {
|
|
|
34
34
|
export function registerGeneralImageAnalysisTool(server) {
|
|
35
35
|
const service = new GeneralImageAnalysisService();
|
|
36
36
|
const retryableAnalyze = withRetry(service.analyzeImage.bind(service), 2, 1000);
|
|
37
|
-
server.tool('analyze_image',
|
|
37
|
+
server.tool('analyze_image', `General-purpose image analysis for scenarios not covered by specialized tools.
|
|
38
|
+
|
|
39
|
+
Use this tool as a FALLBACK when none of the other specialized tools (ui_to_artifact, extract_text_from_screenshot,
|
|
40
|
+
diagnose_error_screenshot, understand_technical_diagram, analyze_data_visualization, ui_diff_check) fit the user's need.
|
|
41
|
+
|
|
42
|
+
This tool provides flexible image understanding for any visual content.`, {
|
|
38
43
|
image_source: z.string().describe('Local file path or remote URL to the image'),
|
|
39
44
|
prompt: z.string().describe('Detailed description of what you want to analyze, extract, or understand from the image. Be specific about your requirements.')
|
|
40
45
|
}, async (params) => {
|
|
@@ -41,7 +41,12 @@ class TextExtractionService extends BaseImageAnalysisService {
|
|
|
41
41
|
export function registerTextExtractionTool(server) {
|
|
42
42
|
const service = new TextExtractionService();
|
|
43
43
|
const retryableExtract = withRetry(service.extractText.bind(service), 2, 1000);
|
|
44
|
-
server.tool('extract_text_from_screenshot',
|
|
44
|
+
server.tool('extract_text_from_screenshot', `Extract and recognize text from screenshots using advanced OCR capabilities.
|
|
45
|
+
|
|
46
|
+
Use this tool ONLY when the user has a screenshot containing text and wants to extract it.
|
|
47
|
+
This tool specializes in OCR for code, terminal output, documentation, and general text extraction.
|
|
48
|
+
|
|
49
|
+
Do NOT use for: UI design conversion, error diagnosis, or diagram understanding.`, {
|
|
45
50
|
image_source: z.string().describe('Local file path or remote URL to the image'),
|
|
46
51
|
prompt: z.string().describe('Instructions for text extraction. Specify what type of text to extract and any formatting requirements.'),
|
|
47
52
|
programming_language: z.string().optional().describe('Optional: specify the programming language if the screenshot contains code (e.g., \'python\', \'javascript\', \'java\'). Leave empty for auto-detection or non-code text.')
|
package/build/tools/ui-diff.js
CHANGED
|
@@ -46,7 +46,12 @@ ${userPrompt}`;
|
|
|
46
46
|
export function registerUiDiffCheckTool(server) {
|
|
47
47
|
const service = new UiDiffCheckService();
|
|
48
48
|
const retryableCompare = withRetry(service.compareUiScreenshots.bind(service), 2, 1000);
|
|
49
|
-
server.tool('ui_diff_check',
|
|
49
|
+
server.tool('ui_diff_check', `Compare two UI screenshots to identify visual differences and implementation discrepancies.
|
|
50
|
+
|
|
51
|
+
Use this tool ONLY when the user wants to compare an expected/reference UI with an actual implementation.
|
|
52
|
+
This tool is specialized for UI quality assurance and design-to-implementation verification.
|
|
53
|
+
|
|
54
|
+
Do NOT use for: general image comparison, error diagnosis, or analyzing single UIs.`, {
|
|
50
55
|
expected_image_source: z.string().describe('Local file path or remote URL to the image'),
|
|
51
56
|
actual_image_source: z.string().describe('Local file path or remote URL to the image'),
|
|
52
57
|
prompt: z.string().describe('Instructions for the comparison. Specify what aspects to focus on or what level of detail is needed.')
|
|
@@ -42,7 +42,15 @@ class UiToArtifactService extends BaseImageAnalysisService {
|
|
|
42
42
|
export function registerUiToArtifactTool(server) {
|
|
43
43
|
const service = new UiToArtifactService();
|
|
44
44
|
const retryableConvert = withRetry(service.convertUiToArtifact.bind(service), 2, 1000);
|
|
45
|
-
server.tool('ui_to_artifact',
|
|
45
|
+
server.tool('ui_to_artifact', `Convert UI screenshots into various artifacts: code, prompts, design specifications, or descriptions.
|
|
46
|
+
|
|
47
|
+
Use this tool ONLY when the user wants to:
|
|
48
|
+
- Generate frontend code from UI design (output_type='code')
|
|
49
|
+
- Create AI prompts for UI generation (output_type='prompt')
|
|
50
|
+
- Extract design specifications (output_type='spec')
|
|
51
|
+
- Get natural language description of the UI (output_type='description')
|
|
52
|
+
|
|
53
|
+
Do NOT use for: screenshots containing text/code to extract, error messages, diagrams, or data visualizations.`, {
|
|
46
54
|
image_source: z.string().describe('Local file path or remote URL to the image'),
|
|
47
55
|
output_type: z.enum(['code', 'prompt', 'spec', 'description']).describe("Type of output to generate. Options: 'code' (generate frontend code), 'prompt' (generate AI prompt for recreating this UI), 'spec' (generate design specification document), 'description' (natural language description of the UI)."),
|
|
48
56
|
prompt: z.string().describe('Detailed instructions describing what to generate from this UI image. Should clearly state the desired output and any specific requirements.')
|
|
@@ -78,7 +78,16 @@ export function registerVideoAnalysisTool(server) {
|
|
|
78
78
|
const retryableAnalyze = withRetry(analysisService.analyzeVideo.bind(analysisService), 2, // Maximum 2 retries
|
|
79
79
|
1000 // 1 second delay
|
|
80
80
|
);
|
|
81
|
-
server.tool('analyze_video',
|
|
81
|
+
server.tool('analyze_video', `Analyze video content using advanced AI vision models.
|
|
82
|
+
|
|
83
|
+
Use this tool when the user wants to:
|
|
84
|
+
- Understand what happens in a video
|
|
85
|
+
- Extract key moments or actions from video
|
|
86
|
+
- Analyze video content, scenes, or sequences
|
|
87
|
+
- Get descriptions of video footage
|
|
88
|
+
- Identify objects, people, or activities in video
|
|
89
|
+
|
|
90
|
+
Supports both local files and remote URL. Maximum file size: 8MB. Supports MP4, MOV, M4V formats.`, {
|
|
82
91
|
video_source: z.string().describe('Local file path or remote URL to the video (supports MP4, MOV, M4V)'),
|
|
83
92
|
prompt: z.string().describe('Detailed text prompt describing what to analyze, extract, or understand from the video')
|
|
84
93
|
}, async (params) => {
|
package/package.json
CHANGED