Skip to main content
Glama
WormBase

WormBase MCP Server

Official
by WormBase

get_strain

Retrieve C. elegans strain details including genotype, source availability, and associated phenotypes from the WormBase database.

Instructions

Get information about a C. elegans strain including genotype, available from, and associated phenotypes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesStrain identifier - strain name (e.g., 'N2', 'CB1370')
widgetsNoSpecific widgets to fetch: overview, phenotypes, references

Implementation Reference

  • src/index.ts:132-153 (registration)
    MCP server.tool registration for the 'get_strain' tool, defining its name, description, input schema, and inline handler function.
    // Tool: Get Strain Information
    server.tool(
      "get_strain",
      "Get information about a C. elegans strain including genotype, available from, and associated phenotypes.",
      {
        id: z.string().describe("Strain identifier - strain name (e.g., 'N2', 'CB1370')"),
        widgets: z.array(z.string()).optional().describe("Specific widgets to fetch: overview, phenotypes, references"),
      },
      async ({ id, widgets }) => {
        try {
          const data = await client.getEntity("strain", id, widgets);
          return {
            content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error fetching strain: ${error}` }],
            isError: true,
          };
        }
      }
    );
  • Zod input schema for the get_strain tool: required 'id' string and optional 'widgets' array.
    {
      id: z.string().describe("Strain identifier - strain name (e.g., 'N2', 'CB1370')"),
      widgets: z.array(z.string()).optional().describe("Specific widgets to fetch: overview, phenotypes, references"),
    },
  • Inline handler function for get_strain tool that calls WormBaseClient.getEntity("strain", id, widgets) and formats the response as text content or error.
    async ({ id, widgets }) => {
      try {
        const data = await client.getEntity("strain", id, widgets);
        return {
          content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error fetching strain: ${error}` }],
          isError: true,
        };
      }
    }
  • WormBaseClient.getEntity generic helper method used by the handler to fetch widget data from WormBase REST API for the 'strain' entity type.
    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;
    }
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 implies a read-only operation ('Get information'), it doesn't describe authentication requirements, rate limits, error conditions, or what happens if the strain ID doesn't exist. For a tool with zero annotation coverage, this leaves significant behavioral 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 and lists key information types without unnecessary elaboration. Every word earns its place, making it appropriately sized for this tool.

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 no annotations and no output schema, the description is incomplete for a tool with 2 parameters. It doesn't explain what the return values look like (e.g., structure of strain information), error handling, or behavioral constraints. For a biological data retrieval tool, more context about the response format would be helpful.

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. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain the relationship between 'widgets' and the listed information types like 'phenotypes'). 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 with a specific verb ('Get information') and resource ('C. elegans strain'), and lists the types of information retrieved (genotype, available from, associated phenotypes). However, it doesn't explicitly differentiate this tool from sibling tools like 'get_gene' or 'get_phenotype' which might retrieve similar biological data.

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 retrieve overlapping information, nor does it specify prerequisites or exclusions for usage.

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