Skip to main content
Glama
WormBase

WormBase MCP Server

Official
by WormBase

get_entity

Retrieve detailed information about WormBase entities like genes, proteins, phenotypes, and expression patterns using entity type and identifier.

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

  • MCP tool handler function for 'get_entity' that calls WormBaseClient.getEntity(type, id, widgets) and returns the data as JSON text or error response.
    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,
        };
      }
    }
  • Input schema (Zod) for the get_entity tool defining parameters: type (enum from ENTITY_TYPES), id (string), optional widgets (string array).
    {
      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"),
    },
  • src/index.ts:246-267 (registration)
    Registration of the 'get_entity' MCP tool using server.tool(), including name, description, schema, and handler function.
    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,
          };
        }
      }
    );
  • WormBaseClient.getEntity method, the core helper function that fetches specified widgets for a given entity type and ID from the WormBase REST API.
    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;
    }
  • TypeScript type definitions for EntityType and ENTITY_TYPES const array, used in the Zod schema for the 'type' parameter in 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];
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 'Get information' implies a read-only operation, the description doesn't specify authentication requirements, rate limits, error conditions, or what format the returned information takes. For a tool with 3 parameters and no output schema, 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 perfectly concise with just two sentences that each serve a clear purpose: stating the tool's function and providing usage guidance. There's no wasted verbiage, and the most important information (purpose and when to use) is front-loaded.

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 complexity (3 parameters, no output schema, no annotations), the description is adequate but incomplete. It excels at purpose and usage guidance but lacks behavioral details about what information is returned, how errors are handled, or authentication requirements. The absence of an output schema means the description should ideally provide more context about return values.

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%, with all parameters well-documented in the schema itself. The description doesn't add any parameter-specific information beyond what's already in the schema (type, id, widgets). This meets the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get information') and resource ('any WormBase entity type'), and explicitly distinguishes it from siblings by specifying 'for entity types not covered by specific tools.' This provides precise differentiation from the listed sibling tools like get_gene, get_disease, etc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('for entity types not covered by specific tools'), providing clear guidance on alternatives. This directly addresses the sibling tools listed, making it easy for an agent to choose between this general-purpose tool and the specialized ones.

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