Skip to main content
Glama

search_ontologies

Search for biological ontologies by name, description, or domain to find structured vocabularies for biomedical data annotation and integration.

Instructions

Search for ontologies by name, description, or domain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch query for ontologies (optional for listing all)
also_search_viewsNoInclude ontology views (default: false)
include_viewsNoInclude views in results (default: false)
display_contextNoInclude JSON-LD context (default: true)
display_linksNoInclude hypermedia links (default: true)

Implementation Reference

  • The handler function that implements the core logic of the 'search_ontologies' tool. Validates arguments using isValidSearchOntologiesArgs, constructs API parameters, calls the BioOntology /ontologies endpoint, and returns the JSON response or error.
    private async handleSearchOntologies(args: any) {
      if (!isValidSearchOntologiesArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid search ontologies arguments');
      }
    
      try {
        const params: any = {
          apikey: this.apiKey,
        };
    
        // Add optional parameters
        if (args.query) params.q = args.query;
        if (args.also_search_views !== undefined) params.also_search_views = args.also_search_views;
        if (args.include_views !== undefined) params.include_views = args.include_views;
        if (args.display_context !== undefined) params.display_context = args.display_context;
        if (args.display_links !== undefined) params.display_links = args.display_links;
    
        const response = await this.apiClient.get('/ontologies', { params });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Error searching ontologies: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:570-584 (registration)
    Tool registration in the ListTools response, defining name, description, and inputSchema for 'search_ontologies'.
    {
      name: 'search_ontologies',
      description: 'Search for ontologies by name, description, or domain',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search query for ontologies (optional for listing all)' },
          also_search_views: { type: 'boolean', description: 'Include ontology views (default: false)' },
          include_views: { type: 'boolean', description: 'Include views in results (default: false)' },
          display_context: { type: 'boolean', description: 'Include JSON-LD context (default: true)' },
          display_links: { type: 'boolean', description: 'Include hypermedia links (default: true)' },
        },
        required: [],
      },
    },
  • Input validation schema (type guard) for search_ontologies arguments, used in the handler to ensure correct parameter types.
    const isValidSearchOntologiesArgs = (
      args: any
    ): args is {
      query?: string;
      also_search_views?: boolean;
      include_views?: boolean;
      display_context?: boolean;
      display_links?: boolean;
    } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        (args.query === undefined || typeof args.query === 'string') &&
        (args.also_search_views === undefined || typeof args.also_search_views === 'boolean') &&
        (args.include_views === undefined || typeof args.include_views === 'boolean') &&
        (args.display_context === undefined || typeof args.display_context === 'boolean') &&
        (args.display_links === undefined || typeof args.display_links === 'boolean')
      );
    };
  • src/index.ts:705-706 (registration)
    Dispatch registration in the CallToolRequestSchema switch statement, routing calls to the handleSearchOntologies method.
    case 'search_ontologies':
      return this.handleSearchOntologies(args);
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 mentions search functionality but fails to describe key traits like whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior, or what the output format looks like (e.g., list of ontologies with fields). This leaves significant gaps for an agent to understand how to invoke it effectively.

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 front-loads the core purpose without any wasted words. It directly states what the tool does, making it easy for an agent to parse quickly. Every part of the sentence earns its place by specifying the action 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 complexity of a search tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain behavioral aspects (e.g., read-only nature, authentication needs) or what the results look like, leaving the agent to guess about invocation and interpretation. This is inadequate for a tool with multiple optional parameters and no structured output guidance.

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 input schema fully documents all 5 parameters with descriptions. The description adds no additional semantic meaning beyond implying a search across name, description, and domain, which aligns with the 'query' parameter but doesn't elaborate on the other parameters (e.g., differences between 'also_search_views' and 'include_views'). Baseline 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 verb ('Search') and resource ('ontologies'), specifying searchable fields ('by name, description, or domain'). It distinguishes from siblings like 'search_properties' and 'search_terms' by focusing on ontologies, but doesn't explicitly differentiate from 'recommend_ontologies' or 'get_ontology_info' in terms of use case.

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 like 'recommend_ontologies' (for suggestions) or 'get_ontology_info' (for detailed info on a specific ontology). It lacks context about prerequisites, such as whether authentication is needed, and doesn't mention any exclusions or preferred scenarios.

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/BioOntology-MCP-Server'

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