Skip to main content
Glama

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[]; }

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