Skip to main content
Glama
WormBase

WormBase MCP Server

Official
by WormBase

get_interactions

Retrieve protein-protein, genetic, or regulatory interactions for C. elegans genes or proteins from the WormBase database to analyze biological relationships.

Instructions

Get protein-protein, genetic, or regulatory interactions for a gene or protein.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGene or protein identifier
interaction_typeNoType of interactions to retrieveall

Implementation Reference

  • Core handler function in WormBaseClient that fetches interaction data from the WormBase REST API widget endpoint, cleans the data using cleanWidgetData, and filters by interaction type (physical, genetic, regulatory, or all).
    async getInteractions(
      id: string,
      interactionType: string = "all"
    ): Promise<InteractionData> {
      const url = `${this.baseUrl}/rest/widget/gene/${encodeURIComponent(id)}/interactions`;
      const data = await this.fetch<any>(url);
    
      const interactions = this.cleanWidgetData(data);
    
      if (interactionType === "all") {
        return interactions as InteractionData;
      }
    
      // Filter by interaction type
      const filtered: Record<string, unknown> = {};
      const interactionsObj = interactions as Record<string, unknown>;
      if (interactionType === "physical" && interactionsObj.physical) {
        filtered.physical = interactionsObj.physical;
      }
      if (interactionType === "genetic" && interactionsObj.genetic) {
        filtered.genetic = interactionsObj.genetic;
      }
      if (interactionType === "regulatory" && interactionsObj.regulatory) {
        filtered.regulatory = interactionsObj.regulatory;
      }
    
      return filtered as InteractionData;
    }
  • src/index.ts:179-199 (registration)
    MCP tool registration for 'get_interactions', including description, Zod input schema, and thin wrapper handler that calls WormBaseClient.getInteractions and returns JSON-formatted response.
    server.tool(
      "get_interactions",
      "Get protein-protein, genetic, or regulatory interactions for a gene or protein.",
      {
        id: z.string().describe("Gene or protein identifier"),
        interaction_type: z.enum(["genetic", "physical", "regulatory", "all"]).optional().default("all").describe("Type of interactions to retrieve"),
      },
      async ({ id, interaction_type }) => {
        try {
          const data = await client.getInteractions(id, interaction_type);
          return {
            content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error fetching interactions: ${error}` }],
            isError: true,
          };
        }
      }
    );
  • Zod schema for input parameters: 'id' (string, gene/protein ID) and 'interaction_type' (enum with default 'all').
    {
      id: z.string().describe("Gene or protein identifier"),
      interaction_type: z.enum(["genetic", "physical", "regulatory", "all"]).optional().default("all").describe("Type of interactions to retrieve"),
    },
  • TypeScript interface defining the output structure for interaction data, with optional arrays for physical, genetic, and regulatory interactions.
    export interface InteractionData {
      physical?: Interaction[];
      genetic?: Interaction[];
      regulatory?: Interaction[];
    }
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 retrieves interactions but doesn't disclose any behavioral traits such as whether this is a read-only operation, potential rate limits, authentication needs, or what the return format looks like (e.g., list of interactions with details). This leaves significant gaps for an agent to understand how the tool behaves in practice.

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 directly states the tool's purpose without any unnecessary words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly, with every word contributing to understanding.

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 complexity of retrieving biological interactions, the lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the return values include (e.g., interaction details, confidence scores, sources), nor does it cover behavioral aspects like error handling or data freshness. This leaves the agent with insufficient context to use the tool effectively beyond basic parameter input.

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 input schema already documents both parameters ('id' and 'interaction_type') with descriptions and an enum for 'interaction_type'. The description adds minimal value beyond this, mentioning the types of interactions but not providing additional syntax, format details, or examples. This meets the baseline for high 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 with specific verbs ('Get') and resources ('protein-protein, genetic, or regulatory interactions for a gene or protein'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish this tool from its siblings like 'get_gene' or 'get_protein', which might also retrieve related information but not specifically interactions.

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 when to prefer 'get_interactions' over sibling tools like 'get_gene' or 'search', nor does it specify any prerequisites or exclusions for usage, leaving the agent to infer context from 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