Skip to main content
Glama
WormBase

WormBase MCP Server

Official
by WormBase

get_ontology

Retrieve Gene Ontology annotations for a specific gene, including molecular function, biological process, and cellular component details from WormBase.

Instructions

Get Gene Ontology (GO) terms for a gene including molecular function, biological process, and cellular component annotations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGene identifier

Implementation Reference

  • MCP tool handler for get_ontology: calls client.getOntology(id), returns JSON stringified data as text content or error response.
    async ({ id }) => {
      try {
        const data = await client.getOntology(id);
        return {
          content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error fetching ontology: ${error}` }],
          isError: true,
        };
      }
    }
  • Input schema for the get_ontology tool: requires a gene identifier string.
    {
      id: z.string().describe("Gene identifier"),
    },
  • src/index.ts:224-243 (registration)
    Registration of the get_ontology MCP tool using server.tool, including description, input schema, and handler function.
    server.tool(
      "get_ontology",
      "Get Gene Ontology (GO) terms for a gene including molecular function, biological process, and cellular component annotations.",
      {
        id: z.string().describe("Gene identifier"),
      },
      async ({ id }) => {
        try {
          const data = await client.getOntology(id);
          return {
            content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error fetching ontology: ${error}` }],
            isError: true,
          };
        }
      }
    );
  • Core helper function in WormBaseClient that performs the HTTP request to WormBase REST API for gene ontology data and processes it with cleanWidgetData.
    async getOntology(id: string): Promise<Record<string, unknown>> {
      const url = `${this.baseUrl}/rest/widget/gene/${encodeURIComponent(id)}/ontology`;
      const data = await this.fetch<any>(url);
      return this.cleanWidgetData(data);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It describes what the tool returns (GO terms with three annotation types) but doesn't mention whether this is a read-only operation, if there are rate limits, authentication requirements, error conditions, or response format. 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, well-structured sentence that efficiently communicates the core functionality. It's front-loaded with the main action and includes necessary detail about the three annotation types without unnecessary elaboration. Every word earns its place.

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 moderate complexity (retrieving structured ontology data), no annotations, and no output schema, the description provides adequate basic information about what the tool does but lacks details about behavioral characteristics, response format, and error handling. It's minimally viable but has clear gaps for a data retrieval tool.

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?

The schema description coverage is 100% with the single parameter 'id' documented as 'Gene identifier'. The description doesn't add any parameter-specific information beyond what's in the schema. With high schema coverage and only one parameter, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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 tool's purpose with specific verbs ('Get Gene Ontology terms') and resources ('for a gene'), and distinguishes it from siblings by specifying the exact annotations returned (molecular function, biological process, cellular component). It goes beyond just restating the name by explaining what GO terms are and what types of annotations are included.

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

Usage Guidelines3/5

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

The description implies usage context by specifying it's for retrieving GO terms for genes, but doesn't explicitly state when to use this tool versus alternatives like get_gene or search. There's no guidance on prerequisites, exclusions, or comparative scenarios with sibling tools.

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