Skip to main content
Glama
Augmented-Nature

GeneOntology MCP Server

validate_go_id

Validate Gene Ontology identifier format and verify term existence for accurate ontology-based analysis and annotation research.

Instructions

Validate GO identifier format and check if term exists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGO identifier to validate

Implementation Reference

  • The main handler function that validates the GO identifier format using regex, normalizes it, queries the QuickGO API to check existence, and returns detailed validation results.
    private async handleValidateGoId(args: any) {
      if (!isValidTermArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'GO ID is required');
      }
    
      try {
        const termId = this.normalizeGoId(args.id);
    
        // Check format
        const isValidFormat = /^GO:\d{7}$/.test(termId);
    
        let exists = false;
        let termInfo = null;
    
        if (isValidFormat) {
          try {
            const response = await this.quickGoClient.get(`/ontology/go/terms/${termId}`);
            termInfo = response.data.results?.[0];
            exists = !!termInfo;
          } catch (e) {
            exists = false;
          }
        }
    
        const validation = {
          input_id: args.id,
          normalized_id: termId,
          valid_format: isValidFormat,
          exists: exists,
          term_info: exists ? {
            name: termInfo?.name,
            namespace: termInfo?.aspect === 'F' ? 'molecular_function' :
                      termInfo?.aspect === 'P' ? 'biological_process' : 'cellular_component',
            obsolete: termInfo?.isObsolete || false
          } : null,
          format_rules: {
            pattern: 'GO:NNNNNNN',
            example: 'GO:0008150',
            description: 'GO identifiers consist of "GO:" followed by exactly 7 digits'
          }
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(validation, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error validating GO ID: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Defines the input schema for the validate_go_id tool, requiring a single 'id' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        id: { type: 'string', description: 'GO identifier to validate' },
      },
      required: ['id'],
    },
  • src/index.ts:314-324 (registration)
    Registers the validate_go_id tool in the ListToolsRequestSchema response, including name, description, and input schema.
    {
      name: 'validate_go_id',
      description: 'Validate GO identifier format and check if term exists',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'GO identifier to validate' },
        },
        required: ['id'],
      },
    },
  • src/index.ts:347-348 (registration)
    Dispatches calls to the validate_go_id tool to its handler function in the CallToolRequestSchema switch statement.
    case 'validate_go_id':
      return this.handleValidateGoId(args);
  • Helper function used by the handler to normalize GO IDs to the standard 'GO:NNNNNNN' format.
    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?

No annotations are provided, so the description carries full burden. It mentions two behaviors (format validation and existence checking) but doesn't disclose important traits like whether this is a read-only operation (likely, but not stated), what happens with invalid formats (e.g., returns error vs. false), response format, or any rate limits. The description is minimal and leaves behavioral aspects ambiguous.

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 extremely concise (one brief sentence) and front-loaded with all necessary information. Every word earns its place by specifying both validation actions. There's no wasted text or redundancy.

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 moderate complexity (validation and existence checking), no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., boolean, validation details, error messages) or behavioral nuances. For a tool with no structured output documentation, the description should provide more context about results and usage.

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% (the 'id' parameter is fully described in the schema as 'GO identifier to validate'), so the baseline is 3. The description adds no additional parameter information beyond what the schema provides (no format examples, no constraints like pattern requirements). It simply restates the parameter's purpose without enhancing understanding.

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 specific verbs ('validate format' and 'check if term exists') and identifies the resource ('GO identifier'). It distinguishes from sibling tools like 'get_go_term' (which retrieves term details) and 'search_go_terms' (which searches for terms) by focusing on validation and existence checking. However, it doesn't explicitly differentiate from 'get_ontology_stats' which might have overlapping functionality.

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 (when you need to validate a GO identifier format and verify term existence), but doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_go_term' (which might also validate as part of retrieval) or 'search_go_terms' (which might handle partial identifiers). No exclusions or prerequisites are mentioned.

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