get_ontology_metrics
Retrieve usage statistics and quality metrics for biological ontologies to assess their reliability and application scope.
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-1107 (handler)The main handler function for the 'get_ontology_metrics' tool. It validates the ontology parameter, makes an API call to the BioOntology /ontologies/{ontology}/metrics endpoint, and returns the metrics as JSON 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 for the tool, specifying the required 'ontology' string parameter.inputSchema: { type: 'object', properties: { ontology: { type: 'string', description: 'Ontology acronym' }, }, required: ['ontology'], },
- src/index.ts:669-679 (registration)Registration of the 'get_ontology_metrics' tool in the MCP server's tools list, including name, description, and input 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'], }, },
- src/index.ts:720-721 (registration)Switch case in the tool dispatcher that routes calls to 'get_ontology_metrics' to the specific handler method.case 'get_ontology_metrics': return this.handleGetOntologyMetrics(args);