Skip to main content
Glama
huiseo

Outline Wiki MCP Server

by huiseo

generate_diagram

Create Mermaid diagrams from text descriptions to visualize concepts and workflows for documentation.

Instructions

Generate a Mermaid diagram from a text description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes

Implementation Reference

  • The MCP tool handler for 'generate_diagram'. Validates brain is enabled, calls brain.generateDiagram, and returns the Mermaid diagram code with a usage note.
    /**
     * Generate a Mermaid diagram from description
     */
    async generate_diagram(args: { description: string }) {
      if (!brain.isEnabled()) {
        return { error: ERROR_MESSAGES.SMART_FEATURES_DISABLED };
      }
    
      const diagram = await brain.generateDiagram(args.description);
    
      return {
        diagram,
        note: 'Copy this Mermaid code into an Outline document to render the diagram.',
      };
    },
  • Core implementation in Brain class that checks if enabled and delegates to LlmProcessor.generateMermaid to produce the diagram.
    async generateDiagram(description: string): Promise<string> {
      this.checkEnabled();
      return this.processor.generateMermaid(description);
    }
  • Zod schema defining the input for generate_diagram tool: requires a 'description' string.
    export const generateDiagramSchema = z.object({
      description: z.string().min(1, 'Description is required'),
    });
  • Registration of the 'generate_diagram' tool in the allTools array, using the schema and providing description.
    createTool(
      'generate_diagram',
      'Generate a Mermaid diagram from a text description.',
      'generate_diagram'
    ),
  • Inclusion of generateDiagramSchema in the central toolSchemas map under key 'generate_diagram'.
    generate_diagram: generateDiagramSchema,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool generates a diagram but doesn't describe what happens after generation (e.g., output format, whether it's saved or displayed, error handling, or any limitations like diagram complexity). This leaves significant gaps in understanding the tool's behavior beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Generate a Mermaid diagram from a text description.' It is front-loaded with the core action and resource, with no wasted words. Every part of the sentence contributes directly to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations, no output schema, and low schema description coverage (0%), the description is incomplete. It doesn't explain the output (e.g., diagram format, success/failure responses) or behavioral aspects like error conditions. For a generative tool with one parameter, more context is needed to fully understand its operation and results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, with one required parameter 'description' of type string. The description adds meaning by specifying it's a 'text description' for generating a Mermaid diagram, which clarifies the parameter's purpose beyond the schema. However, it doesn't provide details on format, examples, or constraints, so it only partially compensates for the low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate a Mermaid diagram from a text description.' It specifies the verb ('Generate') and resource ('Mermaid diagram'), and the input schema confirms the single parameter is a text description. However, it doesn't explicitly differentiate from sibling tools, which are all document/collection management tools unrelated to diagram generation, so the distinction is implicit rather than explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions. Given the sibling tools are unrelated to diagram generation, there's no explicit comparison or usage context provided, leaving the agent to infer usage based on the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/huiseo/outline-smart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server