Skip to main content
Glama

search_ontologies

Search and explore over 1,200 biological ontologies by name, description, or domain. Filter results to include ontology views, JSON-LD context, and hypermedia links for comprehensive research and analysis.

Instructions

Search for ontologies by name, description, or domain

Input Schema

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

Implementation Reference

  • The main handler function that implements the logic for the 'search_ontologies' tool. It validates arguments, constructs API parameters, calls the BioOntology /ontologies endpoint, and returns the JSON response.
    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, }; } }
  • Input validation function specifically for 'search_ontologies' tool arguments, checking types for all optional parameters.
    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:570-584 (registration)
    Registration of the 'search_ontologies' tool in the MCP server's tool list, defining its name, description, and detailed input schema.
    { 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: [], }, },
  • src/index.ts:705-706 (registration)
    Dispatch case in the tool call handler that routes 'search_ontologies' calls to the appropriate handler method.
    case 'search_ontologies': return this.handleSearchOntologies(args);

Other Tools

Related 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