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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'customizable weights' which hints at configuration, but doesn't explain what the tool returns (e.g., ranked list, scores), whether it's a read-only operation, potential rate limits, or authentication needs. For a tool with 9 parameters and no annotations, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. Every word earns its place: 'Get ontology recommendations' (action), 'for text or keywords' (input scope), 'with customizable weights' (key feature). There's no redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (9 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain the output format, behavioral traits like whether it's read-only or has side effects, or how recommendations are generated. For a tool with this many configuration options and no structured output documentation, the description should provide more context about what users can expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'text or keywords' and 'customizable weights', which loosely maps to the 'input' and weight parameters (wc, wa, wd, ws). However, with 100% schema description coverage, the schema already documents all 9 parameters thoroughly. The description adds minimal value beyond what's in the schema, so it meets the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get ontology recommendations for text or keywords with customizable weights'. It specifies the action ('Get ontology recommendations'), the target resource ('ontologies'), and the input types ('text or keywords'). However, it doesn't differentiate this tool from sibling tools like 'search_ontologies' or 'get_ontology_info', which is why it doesn't reach a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'search_ontologies' or 'get_ontology_info', nor does it specify scenarios where this recommendation tool is preferred over direct search or info retrieval. The description only states what the tool does, not when to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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