get_ontology_info
Retrieve detailed information about a specific biological ontology, including optional views, using the BioOntology MCP Server. Input the ontology acronym to explore its structure and entries.
Instructions
Get detailed information about a specific ontology
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| acronym | Yes | Ontology acronym (e.g., NCIT, GO, MESH) | |
| include_views | No | Include ontology views (default: false) |
Implementation Reference
- src/index.ts:868-901 (handler)The handler function that validates arguments, calls the BioOntology API to retrieve ontology information by acronym (optionally including views), and returns the JSON response or error message.private async handleGetOntologyInfo(args: any) { if (!isValidGetOntologyInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid ontology info arguments'); } try { const params: any = { apikey: this.apiKey, }; if (args.include_views !== undefined) params.include_views = args.include_views; const response = await this.apiClient.get(`/ontologies/${args.acronym}`, { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error fetching ontology info: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:585-596 (registration)Tool registration in the ListTools response, defining the tool name, description, and input schema.{ name: 'get_ontology_info', description: 'Get detailed information about a specific ontology', inputSchema: { type: 'object', properties: { acronym: { type: 'string', description: 'Ontology acronym (e.g., NCIT, GO, MESH)' }, include_views: { type: 'boolean', description: 'Include ontology views (default: false)' }, }, required: ['acronym'], }, },
- src/index.ts:192-202 (schema)Runtime validation function (type guard) for get_ontology_info input arguments.const isValidGetOntologyInfoArgs = ( args: any ): args is { acronym: string; include_views?: boolean } => { return ( typeof args === 'object' && args !== null && typeof args.acronym === 'string' && args.acronym.length > 0 && (args.include_views === undefined || typeof args.include_views === 'boolean') ); };
- src/index.ts:707-708 (registration)Dispatch case in the CallToolRequest handler that routes to the specific handler function.case 'get_ontology_info': return this.handleGetOntologyInfo(args);