Skip to main content
Glama
Augmented-Nature

GeneOntology MCP Server

search_go_terms

Search Gene Ontology terms by keyword, name, or definition to find biological functions, processes, and cellular components for research and analysis.

Instructions

Search across Gene Ontology terms by keyword, name, or definition

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (term name, keyword, or definition)
ontologyNoGO ontology to search (default: all)
sizeNoNumber of results to return (1-500, default: 25)
exactNoExact match only (default: false)
include_obsoleteNoInclude obsolete terms (default: false)

Implementation Reference

  • The private async handleSearchGoTerms function that executes the tool logic: validates input, constructs QuickGO API request for term search, processes results, and returns formatted JSON.
    private async handleSearchGoTerms(args: any) {
      if (!isValidSearchArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid search arguments');
      }
    
      try {
        const params: any = {
          query: args.query,
          limit: args.size || 25,
          page: 1,
        };
    
        if (args.ontology && args.ontology !== 'all') {
          params.aspect = args.ontology === 'molecular_function' ? 'F' :
                         args.ontology === 'biological_process' ? 'P' : 'C';
        }
    
        if (args.include_obsolete === false) {
          params.obsolete = 'false';
        }
    
        const response = await this.quickGoClient.get('/ontology/go/search', { params });
    
        const searchResults = {
          query: args.query,
          totalResults: response.data.numberOfHits || 0,
          returnedResults: response.data.results?.length || 0,
          results: response.data.results?.map((term: any) => ({
            id: term.id,
            name: term.name,
            definition: term.definition?.text || 'No definition available',
            namespace: term.aspect === 'F' ? 'molecular_function' :
                      term.aspect === 'P' ? 'biological_process' : 'cellular_component',
            obsolete: term.isObsolete || false,
            url: `https://www.ebi.ac.uk/QuickGO/term/${term.id}`
          })) || []
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(searchResults, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error searching GO terms: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema defining the parameters for search_go_terms tool: query (required), ontology, size, exact, include_obsolete.
    inputSchema: {
      type: 'object',
      properties: {
        query: { type: 'string', description: 'Search query (term name, keyword, or definition)' },
        ontology: {
          type: 'string',
          enum: ['molecular_function', 'biological_process', 'cellular_component', 'all'],
          description: 'GO ontology to search (default: all)'
        },
        size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
        exact: { type: 'boolean', description: 'Exact match only (default: false)' },
        include_obsolete: { type: 'boolean', description: 'Include obsolete terms (default: false)' },
      },
      required: ['query'],
    },
  • src/index.ts:284-302 (registration)
    Registration of the search_go_terms tool in the ListToolsRequestSchema response, including name, description, and input schema.
    {
      name: 'search_go_terms',
      description: 'Search across Gene Ontology terms by keyword, name, or definition',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search query (term name, keyword, or definition)' },
          ontology: {
            type: 'string',
            enum: ['molecular_function', 'biological_process', 'cellular_component', 'all'],
            description: 'GO ontology to search (default: all)'
          },
          size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 },
          exact: { type: 'boolean', description: 'Exact match only (default: false)' },
          include_obsolete: { type: 'boolean', description: 'Include obsolete terms (default: false)' },
        },
        required: ['query'],
      },
    },
  • Type guard helper function used in handleSearchGoTerms to validate input arguments before processing.
    const isValidSearchArgs = (args: any): args is {
      query: string;
      ontology?: string;
      size?: number;
      exact?: boolean;
      include_obsolete?: boolean;
    } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.query === 'string' &&
        args.query.length > 0 &&
        (args.ontology === undefined || ['molecular_function', 'biological_process', 'cellular_component', 'all'].includes(args.ontology)) &&
        (args.size === undefined || (typeof args.size === 'number' && args.size > 0 && args.size <= 500)) &&
        (args.exact === undefined || typeof args.exact === 'boolean') &&
        (args.include_obsolete === undefined || typeof args.include_obsolete === 'boolean')
      );
    };
  • src/index.ts:343-344 (registration)
    Dispatch case in CallToolRequestSchema handler that routes search_go_terms calls to the handler function.
    case 'search_go_terms':
      return this.handleSearchGoTerms(args);
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only operation, potential rate limits, authentication needs, or what the output format looks like (e.g., list of terms with IDs). The description only states the search action without behavioral context.

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 with zero waste. It front-loads the core purpose ('Search across Gene Ontology terms') and adds necessary scope details ('by keyword, name, or definition') without redundancy or fluff.

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 no annotations and no output schema, the description is incomplete for a search tool with 5 parameters. It doesn't explain what results look like (e.g., structured data with IDs and names), how pagination works (implied by 'size' but not described), or behavioral traits like rate limits. This leaves significant gaps for an AI agent.

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%, so the schema fully documents all 5 parameters. The description adds no parameter-specific information beyond implying search scope ('keyword, name, or definition'), which aligns with the schema's 'query' description. Baseline 3 is appropriate as the schema handles parameter semantics.

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 action ('Search across') and resource ('Gene Ontology terms'), specifying the search scope ('by keyword, name, or definition'). It distinguishes from sibling 'get_go_term' (which retrieves specific terms) by emphasizing search functionality, though it doesn't explicitly contrast with 'get_ontology_stats' or 'validate_go_id'.

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?

No guidance is provided on when to use this tool versus alternatives. The description implies usage for searching GO terms, but it doesn't mention when to choose this over 'get_go_term' (e.g., for known IDs vs. keyword searches) or other siblings, nor does it specify prerequisites or exclusions.

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