Skip to main content
Glama
kkShrihari

miEAA3 MCP Server

by kkShrihari

mirna_precursor_converter

Convert between miRNA names and precursor names to support microRNA enrichment analysis and identifier management in bioinformatics workflows.

Instructions

Convert between miRNA names and precursor names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes
directionYes

Implementation Reference

  • MiEAAMirnaPrecursorConverterHandler class with run() method implementing the tool logic: POST to miEAA API with form data, retry on 429, parse tab-separated text response into structured MCP output.
    export class MiEAAMirnaPrecursorConverterHandler {
      async run(args: {
        ids: string[];
        direction: "mirna_to_precursor" | "precursor_to_mirna";
      }) {
        const { ids, direction } = args;
    
        if (!ids || ids.length === 0) {
          throw new Error("ids must be a non-empty array");
        }
    
        const url =
          "https://ccb-compute2.cs.uni-saarland.de/mieaa/api/v1/mirna_precursor_converter/";
    
        /**
         * miEAA web-form compatible mapping
         * (IMPORTANT: these values are NOT documented in the API)
         */
        const input_type =
          direction === "mirna_to_precursor"
            ? "to_precursor"
            : "to_mirna";
    
        const params = new URLSearchParams();
    
        // miEAA expects repeated "mirnas" fields
        ids.forEach(id => params.append("mirnas", id));
    
        params.append("input_type", input_type);
        params.append("conversion_type", "all");
        params.append("output_format", "tabsep");
    
        let res: any = null;
    
        // retry logic for HTTP 429
        for (let attempt = 1; attempt <= 5; attempt++) {
          res = await fetch(url, {
            method: "POST",
            headers: {
              "Content-Type": "application/x-www-form-urlencoded"
            },
            body: params.toString()
          });
    
          if (res.status !== 429) break;
          await sleep(1500 * attempt);
        }
    
        if (!res || !res.ok) {
          const errorText = await res?.text();
          throw new Error(
            `Conversion failed (${res?.status}): ${errorText}`
          );
        }
    
        /**
         * miEAA returns PLAIN TEXT, not JSON
         * Format:
         *   input<TAB>output1;output2
         */
        const text: string = await res.text();
    
        const input_label =
          direction === "mirna_to_precursor" ? "mirna" : "precursor";
    
        const output_label =
          direction === "mirna_to_precursor" ? "precursor" : "mirna";
    
        const results = text
          .trim()
          .split("\n")
          .filter(Boolean)
          .map((line: string) => {
            const [input, output] = line.split(/\t+/);
            return {
              input,
              output: output ? output.split(";") : []
            };
          });
    
        const payload = {
          input_type: input_label,
          output_type: output_label,
          direction,
          results
        };
    
        // MCP tool result (clean + spec-correct)
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(payload)
            }
          ],
          structuredContent: payload
        };
      }
    }
  • Input schema for mirna_precursor_converter tool defined in ListToolsRequestHandler response.
    // miRNA ↔ PRECURSOR CONVERTER
    // -------------------------------------------------
    {
      name: "mirna_precursor_converter",
      description: "Convert between miRNA names and precursor names.",
      inputSchema: {
        type: "object",
        properties: {
          input: { type: "array", items: { type: "string" } },
          direction: {
            type: "string",
            enum: ["mirna_to_precursor", "precursor_to_mirna"]
          }
        },
        required: ["input", "direction"]
      }
    },
  • src/server.ts:51-51 (registration)
    Instantiation of MiEAAMirnaPrecursorConverterHandler as mirnaPrecursorTool.
    const mirnaPrecursorTool = new MiEAAMirnaPrecursorConverterHandler();
  • src/server.ts:207-215 (registration)
    Dispatch logic in CallToolRequestHandler: calls mirnaPrecursorTool.run() for mirna_precursor_converter, mapping input args.
    // --------------------------------------------------
    // miRNA ↔ PRECURSOR CONVERTER
    // --------------------------------------------------
    if (name === "mirna_precursor_converter") {
      return await mirnaPrecursorTool.run({
        ids: (args as any).input,
        direction: (args as any).direction
      });
    }
  • src/server.ts:16-16 (registration)
    Import of the handler class.
    import { MiEAAMirnaPrecursorConverterHandler } from "./handlers/mieaa_mirna_precursor_converter_handler.js";
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 states the conversion action but lacks details on permissions, rate limits, error handling, or output format. For a tool with two parameters and no output schema, 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 directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 tool's complexity (two parameters, no output schema, no annotations), the description is incomplete. It doesn't cover parameter meanings, usage scenarios, or behavioral traits, leaving gaps that could hinder correct tool invocation by an AI agent.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'convert between miRNA names and precursor names', which implies the 'input' and 'direction' parameters, but doesn't explain their semantics, formats, or constraints. This adds minimal value beyond the schema's structure.

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: converting between miRNA names and precursor names. It specifies the verb 'convert' and the resources involved, making the function unambiguous. However, it doesn't differentiate from sibling tools like 'mirbase_version_converter', which might handle similar data but different operations.

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 'mirbase_version_converter' or 'over_representation_analysis', nor does it specify prerequisites or contexts for usage, leaving the agent to infer applicability.

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/kkShrihari/miEAA3_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server