Skip to main content
Glama
WormBase

WormBase MCP Server

Official
by WormBase

get_variation

Retrieve genetic variation details including molecular information, phenotypes, and associated strains from the WormBase database for C. elegans research.

Instructions

Get information about a genetic variation/allele including molecular details, phenotypes, and strains.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesVariation identifier - allele name (e.g., 'e1370') or WormBase variation ID
widgetsNoSpecific widgets to fetch: overview, molecular_details, phenotypes, references

Implementation Reference

  • src/index.ts:156-176 (registration)
    Registration of the MCP 'get_variation' tool. Includes tool name, description, input schema (Zod validation for 'id' and optional 'widgets'), and inline handler that fetches data via WormBaseClient.getEntity('variation', ...) and returns JSON or error.
    server.tool(
      "get_variation",
      "Get information about a genetic variation/allele including molecular details, phenotypes, and strains.",
      {
        id: z.string().describe("Variation identifier - allele name (e.g., 'e1370') or WormBase variation ID"),
        widgets: z.array(z.string()).optional().describe("Specific widgets to fetch: overview, molecular_details, phenotypes, references"),
      },
      async ({ id, widgets }) => {
        try {
          const data = await client.getEntity("variation", id, widgets);
          return {
            content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error fetching variation: ${error}` }],
            isError: true,
          };
        }
      }
    );
  • Core handler logic in WormBaseClient.getEntity(), called by get_variation tool with type='variation'. Fetches data from WormBase REST API endpoints for specified widgets, cleans the data, and handles errors per widget.
    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;
    }
  • Zod input schema specific to get_variation tool: required 'id' string, optional 'widgets' array.
    {
      id: z.string().describe("Variation identifier - allele name (e.g., 'e1370') or WormBase variation ID"),
      widgets: z.array(z.string()).optional().describe("Specific widgets to fetch: overview, molecular_details, phenotypes, references"),
    },
  • EntityType union includes 'variation', used in getEntity type parameter and schema validation.
    // WormBase entity types
    export const ENTITY_TYPES = [
      "gene",
      "protein",
      "transcript",
      "cds",
      "pseudogene",
      "phenotype",
      "disease",
      "strain",
      "variation",
      "transgene",
      "rnai",
      "anatomy_term",
      "life_stage",
      "go_term",
      "interaction",
      "expression_cluster",
      "expr_pattern",
      "paper",
      "person",
      "laboratory",
      "clone",
      "sequence",
      "feature",
      "operon",
      "gene_class",
      "molecule",
      "antibody",
      "construct",
      "motif",
      "homology_group",
      "rearrangement",
      "transposon",
      "transposon_family",
      "pcr_oligo",
      "position_matrix",
      "microarray_results",
      "structure_data",
      "analysis",
      "gene_cluster",
      "expr_profile",
    ] as const;
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. While it mentions what information is returned (molecular details, phenotypes, strains), it doesn't describe critical behaviors like error handling (e.g., what happens if an invalid ID is provided), response format, pagination, rate limits, or authentication requirements. For a read operation with no annotation coverage, this leaves significant gaps.

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 words. Every part of the sentence earns its place by specifying the action, resource, and key information returned. There's zero waste or redundancy.

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 basic purpose but lacks details on usage context, behavioral traits, and output expectations. Without annotations or an output schema, the description should do more to compensate, but it falls short of being complete for effective agent use.

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 already fully documents both parameters ('id' and 'widgets'). The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain format requirements for 'id' beyond the schema's examples, nor does it clarify the purpose or usage of 'widgets' beyond the schema's list. Baseline 3 is appropriate when the schema does the heavy lifting.

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: 'Get information about a genetic variation/allele including molecular details, phenotypes, and strains.' It specifies the verb ('Get'), resource ('genetic variation/allele'), and scope of information returned. However, it doesn't explicitly distinguish this tool from similar sibling tools like 'get_gene' or 'get_phenotype' beyond the resource type.

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 sibling tools like 'get_gene' or 'get_phenotype' that might provide overlapping or related information, nor does it specify prerequisites or exclusions for usage. The user must infer usage from the tool name and description 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