d2-mcp-server
Server Quality Checklist
Latest release: v1.0.0
- Disambiguation5/5
Each tool targets a distinct stage of the D2 workflow: validate, inspect, format, render, list themes, and list layouts. Even though d2_validate and d2_inspect both compile, their return types and purposes are clearly separated, and the descriptions explicitly guide users to d2_inspect over render-ascii for structural previews.
Naming Consistency5/5All tools share the d2_ prefix and use clear imperative verbs, with lookup tools following a consistent list_X pattern. The naming is predictable and makes it easy to infer what each tool does without reading the full description.
Tool Count5/5Six tools is a well-scoped set for a D2 diagram server: rendering, validation, inspection, formatting, theme listing, and layout listing each serve a distinct need. No tool feels redundant, and nothing essential appears missing for the server's purpose.
Completeness5/5The tool set covers the full authoring workflow: validate before rendering, inspect structure without rendering, format source code, and render with configurable themes and layouts. It also exposes theme and layout catalogs so agents can discover valid parameters, leaving no obvious dead ends.
Average 4.6/5 across 6 of 6 tools scored.
See the Tool Scores section below for per-tool breakdowns.
- No community issues in the last 6 months
- 0 commits in the last 12 weeks
- No stable releases found
- No critical vulnerability alerts
- No high-severity vulnerability alerts
- No code scanning findings
- CI status not available
This repository is licensed under MIT License.
This repository includes a README.md file.
No tool usage detected in the last 30 days. Usage tracking helps demonstrate server value.
Tip: use the "Try in Browser" feature on the server page to seed initial usage.
Add a glama.json file to provide metadata about your server.
If you are the author, simply .
If the server belongs to an organization, first add
glama.jsonto the root of your repository:{ "$schema": "https://glama.ai/mcp/schemas/server.json", "maintainers": [ "your-github-username" ] }Then . Browse examples.
Add related servers to improve discoverability.
How to sync the server with GitHub?
Servers are automatically synced at least once per day, but you can also sync manually at any time to instantly update the server profile.
To manually sync the server, click the "Sync Server" button in the MCP server admin interface.
How is the quality score calculated?
The overall quality score combines two components: Tool Definition Quality (70%) and Server Coherence (30%).
Tool Definition Quality measures how well each tool describes itself to AI agents. Every tool is scored 1–5 across six dimensions: Purpose Clarity (25%), Usage Guidelines (20%), Behavioral Transparency (20%), Parameter Semantics (15%), Conciseness & Structure (10%), and Contextual Completeness (10%). The server-level definition quality score is calculated as 60% mean TDQS + 40% minimum TDQS, so a single poorly described tool pulls the score down.
Server Coherence evaluates how well the tools work together as a set, scoring four dimensions equally: Disambiguation (can agents tell tools apart?), Naming Consistency, Tool Count Appropriateness, and Completeness (are there gaps in the tool surface?).
Tiers are derived from the overall score: A (≥3.5), B (≥3.0), C (≥2.0), D (≥1.0), F (<1.0). B and above is considered passing.
Tool Scores
- Behavior4/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior. The description adds valuable context beyond those hints: it normalizes formatting, preserves semantic meaning, requires the d2 binary, and fails if the binary is missing or syntax is invalid. This is consistent with the annotations and gives the agent realistic expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness5/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well organized with clear sections: purpose, behavior, binary requirement, args, returns, examples, and error handling. Every section contributes useful information and there is no filler. The most important scoping detail (requiring the d2 binary) is front-loaded early.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one simple parameter, no output schema, and rich annotations, the description fully covers the calling context: what it does, what it returns, when it fails, and how it differs from siblings. Nothing an agent needs to invoke it correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters3/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the single parameter d2_code is already well described in the schema. The description's Args section repeats the same meaning without adding constraints like minLength or maxLength. Baseline 3 is appropriate because the schema carries the parameter documentation burden.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Format D2 diagram source code using the d2 binary formatter.' It goes on to state the canonicalization goal and semantic equivalence, and it explicitly contrasts with d2_render and d2_validate regarding the WASM vs binary backend, which differentiates it from siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines4/5Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool ('Clean up', 'Normalize after editing') and explicitly distinguishes it from siblings by noting the d2 binary requirement, saying 'unlike d2_render and d2_validate which use WASM.' It does not explicitly say 'use d2_validate for validation' but the context is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior4/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, openWorldHint=false, and destructiveHint=false. The description adds meaningful context beyond these by specifying the exact return structure and the fact that the theme list is built-in, plus notable theme examples that help the agent select appropriate values.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness5/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and front-loaded with purpose and usage, followed by a compact return format and a useful list of notable themes. Each section earns its place; the notable themes list adds practical value for choosing theme IDs despite being slightly longer than a minimal description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no input parameters and annotations already covering safety and idempotency, the description fully compensates for the lack of an output schema by documenting the exact JSON return shape. It also provides enough theme context for the agent to use the tool correctly and connect its output to d2_render.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters4/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so parameter semantics are mostly non-applicable. The description explicitly says 'Args: (none)' and the input schema confirms an empty properties object, which is fully sufficient. The baseline for zero parameters is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action ('List all available D2 diagram themes') with a specific resource and expected content (IDs and names). It is easily distinguished from sibling tools like d2_render and d2_list_layouts because it uniquely refers to theme listing and provides the built-in theme ID inventory.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines4/5Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says theme IDs are meant to be used with d2_render's theme_id parameter, which gives the agent clear downstream usage context. It also notes that no d2 binary is required, clarifying the environmental prerequisite, but it does not explicitly define when-not-to-use or compare against a direct alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior5/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare this a safe, idempotent, read-only operation, but the description adds substantial behavioral context beyond them: the elk performance hazard ('extremely slow in WASM'), the exact output contract (SVG markup starting with <?xml ...?> unless no_xml_tag=true, or ASCII art), the ~500KB font-data implication of skip_fonts, and the multi-board animation semantics of animate_interval/target. It also discloses error behavior ('Returns error with syntax details if D2 code is invalid'). This is rich, decision-relevant behavior disclosure well above the annotation baseline.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness4/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (overview, Args, Returns, Examples, Error Handling) and front-loads the core purpose in the first sentence. Given 15 parameters and complex multi-board/ASCII/font behaviors, the length is largely justified. However, the Args section re-states each parameter that the 100%-covered schema already documents, creating redundancy that costs agent context; a tighter version could reference the schema and add only the warnings, examples, and return contract.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no output schema and high complexity (15 params, interactive behavior between animate_interval and target, two output modalities), the description is complete: it specifies the return type and format, the XML declaration condition, error behavior, and the validation workflow. The examples cover the major invocation patterns (simple, styled, ASCII, animated, HTML-embed, embedded-fonts), so an agent has everything needed to call the tool correctly without inspecting further.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters4/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, and the description does add genuine meaning beyond the schema: concrete D2 syntax examples ('a -> b: connects', styled blocks with theme_id=3, steps: { s1: {a} ... }), a compact key for theme IDs (0, 3, 300, 200), and the return-format context for params like no_xml_tag and ascii. Some duplication exists — layout, target, and animate_interval wording largely mirrors the schema — but the examples section teaches correct parameter combinations in a way the schema alone does not.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource+output: 'Render D2 diagram source code to SVG or ASCII art using the D2 WASM engine.' It further clarifies it compiles D2 code without requiring the d2 binary, making the tool's function unambiguous. The rendering action is inherently distinct from siblings like d2_validate, d2_format, and d2_list_themes, so an agent can select it correctly without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines4/5Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives strong when-not guidance: 'elk is extremely slow in WASM — do NOT use unless explicitly requested' and 'skip_fonts ... Only set false if user explicitly requests embedded fonts.' It also routes to a sibling in the Error Handling section: 'Use d2_validate first to check syntax before rendering,' and points to d2_list_themes for theme options. However, it does not systematically contrast with d2_inspect or d2_format (e.g., when to prefer format/inspect over render), leaving some alternative-selection judgment to the agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior5/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With annotations already declaring readOnly, idempotent, and non-destructive behavior, the description adds meaningful context beyond them: it uses only the compile step (no rendering), is fast (~100ms), filters lifeline-end nodes in sequence diagrams, and returns compile errors. No contradiction exists.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness5/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is organized into clear sections (overview, usage guidance, args, return example, supported diagram types, error handling) with no filler. While longer than minimal, every sentence contributes unique information such as example output and type-specific behavior.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with no output schema, the description is complete: it defines the input, gives a concrete return example, lists supported diagram types, explains error handling, and covers behavioral nuances. An agent has everything needed to invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters3/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already documents d2_code with 100% coverage ('The D2 diagram source code to inspect'). The description's Args section repeats the same semantics without adding new detail, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb phrase ('Parse and summarize the structure of D2 source code without rendering') and clearly states the deliverable: a human-readable summary of shapes, containers, connections, and boards. It explicitly distinguishes itself from d2_render, so an agent can select it correctly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines5/5Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives direct usage guidance: 'Use this INSTEAD of d2_render(ascii=true) for structural previews' and explains why the alternative is unreliable for cross-container connections and reverse edges. This is explicit, actionable routing information.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior5/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the annotations (readOnlyHint, idempotentHint, destructiveHint), the description discloses that the layout list is built-in and requires no d2 binary, and it provides the exact JSON return structure. It also gives behavioral context for layout engines (dagre default, elk trade-offs). No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness5/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear opening statement, usage note, args section, return schema, and layout guidance. Every section serves a purpose and the most important information is front-loaded. The layout guidance is extra but relevant to selecting a layout.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a parameter-free, read-only listing tool with no output schema, the description is remarkably complete. It covers what the tool does, the exact return format, how to apply the results, and practical details like the absence of a d2 binary requirement.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters4/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the input schema already declares an empty properties object with additionalProperties false. The description confirms 'Args: (none)' and therefore adds no misleading or ambiguous parameter information. Baseline for 0 params is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence, 'List available D2 layout engines with descriptions and feature support,' uses a specific verb and resource, immediately distinguishing it from siblings like d2_list_themes and d2_render. The additional note about using layout names with d2_render's layout parameter further reinforces its role.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines4/5Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly tells the agent to use the returned layout names with d2_render's layout parameter, which is actionable guidance. It also notes that no d2 binary is required. However, it does not explicitly name alternatives or state when not to use this tool, though that is less critical for a simple listing tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior5/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark it readOnly and idempotent; the description adds meaningful behavior beyond that: uses the WASM engine, performs a compile step, requires no d2 binary, and never throws but always returns a structured result. These details accurately shape agent expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness5/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well organized with clear sections: purpose, args, returns, examples, and error handling. Every sentence contributes useful information, and the core purpose is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter validation tool, this description is complete. It covers what the tool does, how it behaves, what it returns, error handling, and practical usage context. The absence of an output schema is compensated by an explicit return shape in the description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters3/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents d2_code fully. The description repeats the parameter but adds no extra semantic detail beyond what the schema provides, such as max length or requiredness.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
Description states a specific verb ('Validate') and resource ('D2 diagram source code'), clarifies scope ('syntax and semantic errors'), and differentiates from siblings by noting it detects errors via compile step without rendering. This lets an agent distinguish it from d2_render and d2_format.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines5/5Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit guidance: 'validate first, then d2_render only if valid=true' and 'Debug syntax: get specific line/column error info.' This tells the agent both when to use the tool and how it fits with sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
GitHub Badge
Glama performs regular codebase and documentation scans to:
- Confirm that the MCP server is working as expected.
- Confirm that there are no obvious security issues.
- Evaluate tool definition quality.
Our badge communicates server capabilities, safety, and installation instructions.
Card Badge
Copy to your README.md:
Score Badge
Copy to your README.md:
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ItsJooL/d2-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server