Skip to main content
Glama

recommend_ontologies

Discover relevant biological ontologies for your text or keywords by customizing weights for coverage, acceptance, detail, and specialization criteria. Optimize results with tailored settings.

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)
max_elements_setNoMax ontologies per set (2-4, default: 3)
ontologiesNoComma-separated ontology acronyms to limit evaluation to
output_typeNoOutput type: 1=individual ontologies, 2=ontology sets (default: 1)
waNoWeight for acceptance criterion (0-1, default: 0.15)
wcNoWeight for coverage criterion (0-1, default: 0.55)
wdNoWeight for detail criterion (0-1, default: 0.15)
wsNoWeight for specialization criterion (0-1, default: 0.15)

Implementation Reference

  • The handler function that implements the core logic of the 'recommend_ontologies' tool. It validates the input arguments, constructs the API request parameters for the BioOntology recommender endpoint, performs the HTTP GET request, and returns the response as formatted JSON 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, }; }
  • src/index.ts:621-639 (registration)
    The tool registration in the ListTools response, defining the name, description, and input schema for 'recommend_ontologies'.
    { 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'], }, },
  • Input validation schema as a TypeScript type guard function for the recommend_ontologies tool arguments.
    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:712-713 (registration)
    The switch case in the CallToolRequest handler that routes calls to the recommend_ontologies handler method.
    case 'recommend_ontologies': return this.handleRecommendOntologies(args);

Other Tools

Related Tools

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