Skip to main content
Glama

recommend_ontologies

Find relevant biological ontologies for your text or keywords by customizing weighting criteria like coverage, acceptance, detail, and specialization.

Instructions

Get ontology recommendations for text or keywords with customizable weights

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesInput text or comma-separated keywords
input_typeNoInput type: 1=text, 2=keywords (default: 1)
output_typeNoOutput type: 1=individual ontologies, 2=ontology sets (default: 1)
max_elements_setNoMax ontologies per set (2-4, default: 3)
wcNoWeight for coverage criterion (0-1, default: 0.55)
waNoWeight for acceptance criterion (0-1, default: 0.15)
wdNoWeight for detail criterion (0-1, default: 0.15)
wsNoWeight for specialization criterion (0-1, default: 0.15)
ontologiesNoComma-separated ontology acronyms to limit evaluation to

Implementation Reference

  • The main handler function that validates input arguments, constructs parameters for the BioOntology /recommender API endpoint, fetches recommendations, and returns the JSON response or an error message.
    private async handleRecommendOntologies(args: any) { if (!isValidRecommendOntologiesArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid recommend ontologies arguments'); } try { const params: any = { input: args.input, apikey: this.apiKey, }; // Add optional parameters if (args.input_type !== undefined) params.input_type = args.input_type; if (args.output_type !== undefined) params.output_type = args.output_type; if (args.max_elements_set !== undefined) params.max_elements_set = args.max_elements_set; if (args.wc !== undefined) params.wc = args.wc; if (args.wa !== undefined) params.wa = args.wa; if (args.wd !== undefined) params.wd = args.wd; if (args.ws !== undefined) params.ws = args.ws; if (args.ontologies) params.ontologies = args.ontologies; const response = await this.apiClient.get('/recommender', { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error recommending ontologies: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Type guard function validating the structure and types of arguments for the recommend_ontologies tool.
    const isValidRecommendOntologiesArgs = ( args: any ): args is { input: string; input_type?: number; output_type?: number; max_elements_set?: number; wc?: number; wa?: number; wd?: number; ws?: number; ontologies?: string; } => { return ( typeof args === 'object' && args !== null && typeof args.input === 'string' && args.input.length > 0 && (args.input_type === undefined || (typeof args.input_type === 'number' && [1, 2].includes(args.input_type))) && (args.output_type === undefined || (typeof args.output_type === 'number' && [1, 2].includes(args.output_type))) && (args.max_elements_set === undefined || (typeof args.max_elements_set === 'number' && [2, 3, 4].includes(args.max_elements_set))) && (args.wc === undefined || (typeof args.wc === 'number' && args.wc >= 0 && args.wc <= 1)) && (args.wa === undefined || (typeof args.wa === 'number' && args.wa >= 0 && args.wa <= 1)) && (args.wd === undefined || (typeof args.wd === 'number' && args.wd >= 0 && args.wd <= 1)) && (args.ws === undefined || (typeof args.ws === 'number' && args.ws >= 0 && args.ws <= 1)) && (args.ontologies === undefined || typeof args.ontologies === 'string') ); };
  • src/index.ts:621-639 (registration)
    Registers the recommend_ontologies tool in the ListTools response, including name, description, and detailed inputSchema.
    { name: 'recommend_ontologies', description: 'Get ontology recommendations for text or keywords with customizable weights', inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'Input text or comma-separated keywords' }, input_type: { type: 'number', description: 'Input type: 1=text, 2=keywords (default: 1)', enum: [1, 2] }, output_type: { type: 'number', description: 'Output type: 1=individual ontologies, 2=ontology sets (default: 1)', enum: [1, 2] }, max_elements_set: { type: 'number', description: 'Max ontologies per set (2-4, default: 3)', enum: [2, 3, 4] }, wc: { type: 'number', description: 'Weight for coverage criterion (0-1, default: 0.55)', minimum: 0, maximum: 1 }, wa: { type: 'number', description: 'Weight for acceptance criterion (0-1, default: 0.15)', minimum: 0, maximum: 1 }, wd: { type: 'number', description: 'Weight for detail criterion (0-1, default: 0.15)', minimum: 0, maximum: 1 }, ws: { type: 'number', description: 'Weight for specialization criterion (0-1, default: 0.15)', minimum: 0, maximum: 1 }, ontologies: { type: 'string', description: 'Comma-separated ontology acronyms to limit evaluation to' }, }, required: ['input'], }, },
  • src/index.ts:712-713 (registration)
    Switch case in CallToolRequest handler that routes recommend_ontologies calls to the specific handler method.
    case 'recommend_ontologies': return this.handleRecommendOntologies(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