Skip to main content
Glama

get_entity

Retrieve detailed information about WormBase entities like genes, proteins, phenotypes, and expression patterns to access nematode genomics data.

Instructions

Get information about any WormBase entity type. Use this for entity types not covered by specific tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesEntity type
idYesEntity identifier
widgetsNoSpecific widgets to fetch

Implementation Reference

  • src/index.ts:245-267 (registration)
    MCP tool registration for 'get_entity', including description, input schema using Zod and ENTITY_TYPES, and async handler that calls WormBaseClient.getEntity and returns JSON-formatted response or error.
    // Tool: Get Generic Entity server.tool( "get_entity", "Get information about any WormBase entity type. Use this for entity types not covered by specific tools.", { type: z.enum(ENTITY_TYPES).describe("Entity type"), id: z.string().describe("Entity identifier"), widgets: z.array(z.string()).optional().describe("Specific widgets to fetch"), }, async ({ type, id, widgets }) => { try { const data = await client.getEntity(type, id, widgets); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } catch (error) { return { content: [{ type: "text", text: `Error fetching entity: ${error}` }], isError: true, }; } } );
  • Definition of ENTITY_TYPES enum used in the input schema for the 'type' parameter of get_entity tool.
    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; export type EntityType = (typeof ENTITY_TYPES)[number];
  • Handler function for the get_entity tool: fetches data using WormBaseClient.getEntity and returns formatted text content or error.
    async ({ type, id, widgets }) => { try { const data = await client.getEntity(type, id, widgets); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } catch (error) { return { content: [{ type: "text", text: `Error fetching entity: ${error}` }], isError: true, }; } }
  • Core helper method in WormBaseClient that implements fetching entity data from WormBase REST API by querying widgets for the given type and ID, with data cleaning.
    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; }

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