Skip to main content
Glama
WormBase

WormBase MCP Server

Official
by WormBase

get_disease

Retrieve human disease information using C. elegans models, including associated genes and orthologs from the WormBase database.

Instructions

Get information about human diseases with C. elegans models, including associated genes and orthologs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDisease identifier - DOID or WormBase disease ID
widgetsNoSpecific widgets to fetch: overview, genes, references

Implementation Reference

  • src/index.ts:109-130 (registration)
    Registers the 'get_disease' MCP tool, including description, Zod input schema for 'id' and optional 'widgets', and thin async handler that delegates to WormBaseClient.getEntity('disease', id, widgets), formats response as JSON text content, with error handling.
    // Tool: Get Disease Information
    server.tool(
      "get_disease",
      "Get information about human diseases with C. elegans models, including associated genes and orthologs.",
      {
        id: z.string().describe("Disease identifier - DOID or WormBase disease ID"),
        widgets: z.array(z.string()).optional().describe("Specific widgets to fetch: overview, genes, references"),
      },
      async ({ id, widgets }) => {
        try {
          const data = await client.getEntity("disease", id, widgets);
          return {
            content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error fetching disease: ${error}` }],
            isError: true,
          };
        }
      }
    );
  • Implements the core logic for the get_disease tool by fetching WormBase REST API widget data for 'disease' entities (/rest/widget/disease/{id}/{widget}), processing multiple widgets, cleaning data with cleanWidgetData helper, and returning aggregated result object.
    async getEntity(
      type: EntityType,
      id: string,
      widgets?: string[]
    ): Promise<Record<string, unknown>> {
      const defaultWidgets = ["overview"];
      const requestedWidgets = widgets || defaultWidgets;
    
      const result: Record<string, unknown> = { id, type };
    
      for (const widget of requestedWidgets) {
        try {
          const url = `${this.baseUrl}/rest/widget/${type}/${encodeURIComponent(id)}/${widget}`;
          const data = await this.fetch<any>(url);
          result[widget] = this.cleanWidgetData(data);
        } catch (error) {
          result[widget] = { error: `Failed to fetch ${widget}` };
        }
      }
    
      return result;
    }
  • Helper function used by getEntity to clean and simplify raw WormBase API widget data, handling fields unwrapping, nulls, nested objects, entity references, and recursive simplification.
    private cleanWidgetData(data: any): Record<string, unknown> {
      if (!data) return {};
    
      // The API typically wraps data in a "fields" object
      const fields = data.fields || data;
    
      // Clean and simplify the data structure
      const cleaned: Record<string, unknown> = {};
    
      for (const [key, value] of Object.entries(fields)) {
        if (value === null || value === undefined) continue;
    
        // Handle nested data structures
        if (typeof value === "object" && value !== null) {
          const obj = value as Record<string, unknown>;
          if ("data" in obj) {
            cleaned[key] = obj.data;
          } else if ("id" in obj && "label" in obj) {
            // Entity reference
            cleaned[key] = {
              id: obj.id,
              label: obj.label,
              class: obj.class || obj.taxonomy,
            };
          } else {
            cleaned[key] = this.simplifyValue(value);
          }
        } else {
          cleaned[key] = value;
        }
      }
    
      return cleaned;
    }
  • Defines 'disease' as a valid EntityType in the ENTITY_TYPES const array, used in type safety for getEntity calls.
    "disease",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what information is retrieved but doesn't cover aspects like read-only nature, potential rate limits, error handling, or response format. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 that front-loads the core purpose without unnecessary details. Every word earns its place, making it easy to parse quickly.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose but lacks behavioral context and usage guidelines, which are important for an agent to operate effectively without structured annotations.

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?

Schema description coverage is 100%, so the schema fully documents the parameters (id and widgets). The description adds no additional meaning beyond what the schema provides, such as explaining the significance of DOID vs. WormBase IDs or widget purposes. Baseline 3 is appropriate when the schema handles parameter documentation.

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 verb 'Get' and the resource 'information about human diseases with C. elegans models', specifying it includes 'associated genes and orthologs'. It distinguishes from siblings like get_gene or get_phenotype by focusing on disease information, though it doesn't explicitly contrast with them.

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?

No guidance is provided on when to use this tool versus alternatives like get_entity or search. The description implies usage for disease data but lacks explicit context, prerequisites, or exclusions, leaving the agent to infer based on tool names 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/WormBase/wormbase-mcp'

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