get_ontology_metrics
Analyze usage statistics and assess quality metrics for a specific ontology to evaluate its performance and relevance in biological research.
Instructions
Get usage statistics and quality metrics for an ontology
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ontology | Yes | Ontology acronym |
Implementation Reference
- src/index.ts:1077-1108 (handler)The handler function that validates input, fetches ontology metrics from the BioPortal API endpoint `/ontologies/{ontology}/metrics`, and returns the JSON response or an error message.private async handleGetOntologyMetrics(args: any) { if (!args.ontology) { throw new McpError(ErrorCode.InvalidParams, 'Invalid ontology metrics arguments'); } try { const params: any = { apikey: this.apiKey, }; const response = await this.apiClient.get(`/ontologies/${args.ontology}/metrics`, { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error fetching ontology metrics: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:672-678 (schema)Input schema defining the required 'ontology' parameter as a string.inputSchema: { type: 'object', properties: { ontology: { type: 'string', description: 'Ontology acronym' }, }, required: ['ontology'], },
- src/index.ts:720-721 (registration)Registration in the tool request handler switch statement dispatching to the handler function.case 'get_ontology_metrics': return this.handleGetOntologyMetrics(args);
- src/index.ts:669-679 (registration)Tool registration in the tools list provided to MCP server, including name, description, and schema.{ name: 'get_ontology_metrics', description: 'Get usage statistics and quality metrics for an ontology', inputSchema: { type: 'object', properties: { ontology: { type: 'string', description: 'Ontology acronym' }, }, required: ['ontology'], }, },