Skip to main content
Glama
Augmented-Nature

GeneOntology MCP Server

get_go_term

Retrieve detailed information about a specific Gene Ontology term using its identifier to support ontology-based analysis and functional annotation research.

Instructions

Get detailed information for a specific GO term

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGO term identifier (e.g., GO:0008150)

Implementation Reference

  • The core handler function that implements the logic for the 'get_go_term' tool. It validates the input arguments, normalizes the GO term ID, queries the QuickGO API, processes the response data into a structured format, and returns the result as MCP content or an error response.
    private async handleGetGoTerm(args: any) {
      if (!isValidTermArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'GO term ID is required');
      }
    
      try {
        const termId = this.normalizeGoId(args.id);
        const response = await this.quickGoClient.get(`/ontology/go/terms/${termId}`);
    
        const termInfo = response.data.results?.[0];
        if (!termInfo) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  error: `GO term not found: ${termId}`,
                  suggestion: 'Check the GO ID format (e.g., GO:0008150) or search for the term first'
                }, null, 2),
              },
            ],
            isError: true,
          };
        }
    
        const detailedTerm = {
          id: termInfo.id,
          name: termInfo.name,
          definition: {
            text: termInfo.definition?.text || 'No definition available',
            references: termInfo.definition?.xrefs || []
          },
          namespace: termInfo.aspect === 'F' ? 'molecular_function' :
                    termInfo.aspect === 'P' ? 'biological_process' : 'cellular_component',
          obsolete: termInfo.isObsolete || false,
          replaced_by: termInfo.replacedBy || [],
          consider: termInfo.consider || [],
          synonyms: termInfo.synonyms || [],
          xrefs: termInfo.xrefs || [],
          url: `https://www.ebi.ac.uk/QuickGO/term/${termInfo.id}`,
          amigo_url: `http://amigo.geneontology.org/amigo/term/${termInfo.id}`
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(detailedTerm, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching GO term: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:303-313 (registration)
    The tool registration entry in the ListToolsRequestSchema handler, defining the name, description, and input schema for 'get_go_term'.
    {
      name: 'get_go_term',
      description: 'Get detailed information for a specific GO term',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'GO term identifier (e.g., GO:0008150)' },
        },
        required: ['id'],
      },
    },
  • Type guard function used to validate the input arguments for the 'get_go_term' tool, ensuring the required 'id' field is a non-empty string.
    const isValidTermArgs = (args: any): args is { id: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.id === 'string' &&
        args.id.length > 0
      );
    };
  • src/index.ts:345-346 (registration)
    The switch case in the CallToolRequestSchema handler that routes calls to the 'get_go_term' tool to its handler function.
    case 'get_go_term':
      return this.handleGetGoTerm(args);
  • Helper function used by the handler to normalize GO term IDs, adding 'GO:' prefix if missing and the input matches 7 digits.
    private normalizeGoId(id: string): string {
      if (id.startsWith('GO:')) {
        return id;
      }
      if (/^\d{7}$/.test(id)) {
        return `GO:${id}`;
      }
      return id;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information but doesn't describe traits like whether it's read-only (implied by 'Get'), error handling for invalid IDs, rate limits, authentication needs, or response format. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 unnecessary words. It is front-loaded with the core action ('Get detailed information'), making it easy to parse. Every part of the sentence earns its place by specifying the resource and scope.

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 tool's complexity (retrieving detailed information), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'detailed information' includes (e.g., term name, definition, relationships), potential errors, or response structure. For a tool with these gaps in structured data, the description should provide more context to be fully helpful.

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 input schema has 100% description coverage, with the 'id' parameter clearly documented as a GO term identifier with an example. The description adds no additional parameter semantics beyond what the schema provides, such as format constraints or validation rules. With high schema coverage, 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.

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 a specific verb ('Get') and resource ('detailed information for a specific GO term'). It distinguishes from siblings like 'search_go_terms' (which likely searches multiple terms) and 'validate_go_id' (which validates IDs rather than retrieving information). However, it doesn't explicitly mention what constitutes 'detailed information' or differentiate from 'get_ontology_stats' which might provide broader statistics.

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 prerequisites (e.g., needing a valid GO term ID), exclusions, or comparisons to sibling tools like 'search_go_terms' for broader queries or 'validate_go_id' for ID validation. Usage is implied but not explicitly stated.

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/Augmented-Nature/GeneOntology-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server