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);

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