MCP Server for converting Mermaid diagram code to images (PNG, JPG, PDF, SVG)
Server has 2 tools with explicit registration and schemas visible in main.py. Both tools have Chinese descriptions and reasonably complete input schemas. However, descriptions are sparse (200+ chars, well above the 10-1024 optimal range but not optimized for LLM selection), parameter descriptions lack depth regarding constraints and use cases, output schemas are not formally documented, and error handling is present but could guide recovery better. No tool annotations (readOnlyHint, destructiveHint, idempotentHint) are used. The tools follow a verb_noun pattern but descriptions do not explain WHEN to use each tool or dependencies between them.
将 Mermaid 图表代码转换为多种格式的图像(PNG、JPG、PDF、SVG)。
通过尝试简单转换来验证 Mermaid 图表语法。
Output schema not formally documented in tool description or response type hints. The convert_mermaid_to_image tool returns a Dict[str, Any] with fields 'success', 'data', 'message', 'error', but LLMs cannot infer the structure of nested 'data' object without explicit schema documentation.
Parameter descriptions lack specificity on constraints and use cases. E.g., 'background_color' states 'hex code (如 FF0000) or named color (如 !white)' but does not document that this parameter is optional, when it applies (image formats only?), or what happens if invalid hex is passed.
No tool annotations. Both tools are read-only (they generate outputs without modifying state), but readOnlyHint is not declared. This makes it harder for agents to reason about idempotency and retry safety.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 55 | <=2025-11-25 | v2 |
| 2026-03-09 | D | 57 | - | v1 |
validate_mermaid_syntax description is too brief (46 chars: '通过尝试简单转换来验证 Mermaid 图表语法。') and does not explain when to use it vs convert_mermaid_to_image, what 'validation success' means, or what validation errors are returned.
Error handling returns helpful messages ('无效的输出格式') but does not classify errors as retryable vs user-fixable. E.g., a timeout or connection error (retryable) is indistinguishable from an invalid Mermaid syntax error (user must fix code).
Output format parameter validation is present but does not use an enum. The code checks valid_formats list, but the JSON schema (shown in tool definition) lists format as string with description 'png、jpg、svg 或 pdf', no enum constraint. LLMs may hallucinate invalid formats.
Width and height parameters are optional integers with no documented bounds. No minimum, maximum, or guidance on aspect ratio. An LLM could pass width=999999 or height=1, causing API failures or unexpected outputs.
Tool composition: validate_mermaid_syntax and convert_mermaid_to_image overlap. The latter already validates syntax and returns errors. An agent must decide whether to call validate first (extra round-trip) or skip it. No guidance on the relationship is provided.