Skip to main content
Glama
kegg-mcp-server

kegg-mcp-server

by Lucas-Servi

render_pathway_ascii

Read-onlyIdempotent

Render KEGG pathways as ASCII text for LLM analysis, with linear reaction-chain or 2D grid layouts to inspect reaction sequences and spatial relationships.

Instructions

Render a KEGG pathway as ASCII text optimized for LLM consumption.

Two styles available:

  • 'chain': Linear reaction flow text showing substrate->enzyme->product chains. Robust and compact. Best for understanding reaction sequences.

  • 'grid': 2D spatial layout using KGML coordinates. Shows the pathway topology with box-and-arrow rendering. Best for seeing spatial relationships.

Args: pathway_id: KEGG pathway ID (e.g. 'hsa00010' for human glycolysis). Must be organism-specific; reference pathways (map*) have limited KGML. style: 'chain' (default, linear text) or 'grid' (2D spatial layout). max_width: Maximum line width in characters (40-200, default 100). max_height: Grid mode only: maximum height in lines (20-80, default 40).

Input Schema

NameRequiredDescriptionDefault
styleNochain
max_widthNo
max_heightNo
pathway_idYes

Output Schema

NameRequiredDescriptionDefault
asciiYes
styleYes
titleYes
legendNo
organismNo
truncatedNo
node_countYes
pathway_idYes
reaction_countYes
relation_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.5.0
    • removedOutput schema / $defs
      Removed value: -{
      -  "AsciiPathway": {
      -    "description": "Result of rendering a KEGG pathway as ASCII art.",
      -    "properties": {
      -      "ascii": {
      -        "title": "Ascii",
      -        "type": "string"
      -      },
      -      "legend": {
      -        "default": [],
      -        "items": {
      -          "additionalProperties": {
      -            "type": "string"
      -          },
      -          "type": "object"
      -        },
      -        "title": "Legend",
      -        "type": "array"
      -      },
      -      "node_count": {
      -        "title": "Node Count",
      -        "type": "integer"
      -      },
      -      "organism": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Organism"
      -      },
      -      "pathway_id": {
      -        "title": "Pathway Id",
      -        "type": "string"
      -      },
      -      "reaction_count": {
      -        "title": "Reaction Count",
      -        "type": "integer"
      -      },
      -      "relation_count": {
      -        "default": 0,
      -        "title": "Relation Count",
      -        "type": "integer"
      -      },
      -      "style": {
      -        "enum": [
      -          "chain",
      -          "grid"
      -        ],
      -        "title": "Style",
      -        "type": "string"
      -      },
      -      "title": {
      -        "title": "Title",
      -        "type": "string"
      -      },
      -      "truncated": {
      -        "default": false,
      -        "title": "Truncated",
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "pathway_id",
      -      "title",
      -      "style",
      -      "ascii",
      -      "node_count",
      -      "reaction_count"
      -    ],
      -    "title": "AsciiPathway",
      -    "type": "object"
      -  },
      -  "ErrorResult": {
      -    "description": "Structured error returned by a tool when the KEGG API fails.\n\nA tool returns this instead of raising so the model can reason about\nthe failure and decide whether to retry, change inputs, or give up.\nA point lookup that receives a 404 uses code ``not_found``; an empty search\nremains a successful result with no items.",
      -    "properties": {
      -      "code": {
      -        "default": "kegg_api_error",
      -        "title": "Code",
      -        "type": "string"
      -      },
      -      "error": {
      -        "title": "Error",
      -        "type": "string"
      -      },
      -      "hint": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Hint"
      -      },
      -      "path": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Path"
      -      },
      -      "retryable": {
      -        "default": false,
      -        "title": "Retryable",
      -        "type": "boolean"
      -      },
      -      "status": {
      -        "anyOf": [
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "title": "Status"
      -      }
      -    },
      -    "required": [
      -      "error"
      -    ],
      -    "title": "ErrorResult",
      -    "type": "object"
      -  }
      -}
    • addedOutput schema / description
      Added value: +"Result of rendering a KEGG pathway as ASCII art."
    • addedOutput schema / properties / ascii
      Added value: +{
      +  "title": "Ascii",
      +  "type": "string"
      +}
    • addedOutput schema / properties / legend
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "additionalProperties": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  "title": "Legend",
      +  "type": "array"
      +}
    • addedOutput schema / properties / node_count
      Added value: +{
      +  "title": "Node Count",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / organism
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Organism"
      +}
    • addedOutput schema / properties / pathway_id
      Added value: +{
      +  "title": "Pathway Id",
      +  "type": "string"
      +}
    • addedOutput schema / properties / reaction_count
      Added value: +{
      +  "title": "Reaction Count",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / relation_count
      Added value: +{
      +  "default": 0,
      +  "title": "Relation Count",
      +  "type": "integer"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "$ref": "#/$defs/AsciiPathway"
      -    },
      -    {
      -      "$ref": "#/$defs/ErrorResult"
      -    }
      -  ],
      -  "title": "Result"
      -}
    • addedOutput schema / properties / style
      Added value: +{
      +  "enum": [
      +    "chain",
      +    "grid"
      +  ],
      +  "title": "Style",
      +  "type": "string"
      +}
    • addedOutput schema / properties / title
      Added value: +{
      +  "title": "Title",
      +  "type": "string"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "default": false,
      +  "title": "Truncated",
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "pathway_id",
      +  "title",
      +  "style",
      +  "ascii",
      +  "node_count",
      +  "reaction_count"
      +]
    • changedOutput schema / title
      Previous value: -"render_pathway_asciiOutput"New value: +"AsciiPathway"
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnly/idempotent/openWorld/non-destructive, so the safety profile is covered structurally. The description adds real value beyond that: the map* KGML limitation and the grid-only scope of max_height. It does not disclose failure behavior for invalid or unsupported pathway IDs, or any cost/limits on rendering.

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

Conciseness4/5

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

Front-loaded with the one-line purpose, then a two-bullet mode comparison, then a compact Args block. Every line adds information, though the Args block partially overlaps the schema's defaults and could be trimmed slightly.

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

Completeness4/5

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

An output schema exists so return-value description is not required. With 4 params, 0% schema coverage and a rich enum/mode dimension, the description covers what an agent needs to call it correctly; minor gaps are error handling and whether the rendered output is paged or truncated by max_width/max_height beyond the stated bounds.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does: it explains pathway_id format with a concrete example ('hsa00010'), the biological distinction between organism-specific and map* IDs, the enum meaning of style, and numeric ranges for max_width (40-200) and max_height (20-80) that the schema itself lacks.

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

Purpose5/5

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

States a specific verb and resource ('Render a KEGG pathway as ASCII text') plus the intended consumer ('optimized for LLM consumption'). Among the siblings, which are all data-lookup tools (get_pathway_info, get_pathway_genes, search_pathways), this is clearly the only visualization/rendering tool, so differentiation is implicit but unambiguous.

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

Usage Guidelines4/5

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

Gives explicit selection criteria between the two modes ('chain' best for reaction sequences, 'grid' best for spatial relationships) and warns that pathway_id must be organism-specific because reference map* pathways have limited KGML. It does not explicitly contrast this tool with get_pathway_info/get_pathway_reactions, which would be the natural 'when not to use' guidance.

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