Skip to main content
Glama
kkShrihari

miEAA3 MCP Server

by kkShrihari

mirbase_version_converter

Convert miRNA identifiers between different miRBase versions for consistent analysis across datasets.

Instructions

Convert miRNA identifiers between miRBase versions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mirnasYes
source_versionYes
target_versionYes

Implementation Reference

  • The MiEAAMirBaseConverterHandler class with the run() method that executes the tool by posting miRNA lists to the miEAA miRBase converter API, handling rate limits, parsing responses, and formatting results with status for each miRNA.
    export class MiEAAMirBaseConverterHandler {
      async run(args: {
        mirnas: string[];
        from_version: string;
        to_version: string;
      }) {
        const { mirnas, from_version, to_version } = args;
    
        if (!mirnas?.length) {
          throw new Error("mirnas must be a non-empty array");
        }
    
        const url =
          "https://ccb-compute2.cs.uni-saarland.de/mieaa/api/v1/mirbase_converter/";
    
        const params = new URLSearchParams();
        mirnas.forEach(m => params.append("mirnas", m));
        params.append("input_type", "mirna");
        params.append("mirbase_input_version", from_version);
        params.append("mirbase_output_version", to_version);
    
        let res: any = null;
    
        for (let attempt = 1; attempt <= 3; 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(1000 * attempt);
        }
    
        if (!res || !res.ok) {
          const errorText = await res?.text();
          throw new Error(
            `miRBase conversion failed (${res?.status}): ${errorText}`
          );
        }
    
        const text: string = await res.text();
    
        // API only returns problematic entries
        const apiResults = text
          .trim()
          .split("\n")
          .filter(Boolean)
          .map((line: string) => {
            const [input, output] = line.split(/\t+/);
            return { input, output: output ?? null };
          });
    
        // Normalize output for ALL inputs
        const conversions = mirnas.map(mirna => {
          const hit = apiResults.find(r => r.input === mirna);
    
          if (!hit) {
            return {
              input: mirna,
              output: mirna,
              status: "unchanged",
              reason: "miRNA name is identical across miRBase versions"
            };
          }
    
          if (hit.output === null) {
            return {
              input: mirna,
              output: null,
              status: "unmappable",
              reason:
                `No unambiguous miRBase mapping from ${from_version} to ${to_version}`
            };
          }
    
          return {
            input: mirna,
            output: hit.output,
            status: "converted",
            reason: `Renamed between miRBase ${from_version} and ${to_version}`
          };
        });
    
        // MCP tool result (clean + spec-correct)
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ conversions })
            }
          ],
          structuredContent: {
            conversions
          }
        };
      }
    }
  • Input schema and metadata for the mirbase_version_converter tool, provided in the ListToolsRequest response.
      {
        name: "mirbase_version_converter",
        description: "Convert miRNA identifiers between miRBase versions.",
        inputSchema: {
          type: "object",
          properties: {
            mirnas: { type: "array", items: { type: "string" } },
            source_version: { type: "string" },
            target_version: { type: "string" }
          },
          required: ["mirnas", "source_version", "target_version"]
        }
      }
    ]
  • src/server.ts:52-52 (registration)
    Instantiation of the MiEAAMirBaseConverterHandler as mirbaseTool for use in tool dispatching.
    const mirbaseTool = new MiEAAMirBaseConverterHandler();
  • src/server.ts:217-226 (registration)
    Dispatch logic in the CallToolRequest handler that routes calls to mirbase_version_converter to the mirbaseTool.run() method, mapping input arguments appropriately.
    // --------------------------------------------------
    // miRBASE VERSION CONVERTER
    // --------------------------------------------------
    if (name === "mirbase_version_converter") {
      return await mirbaseTool.run({
        mirnas: (args as any).mirnas,
        from_version: (args as any).source_version,
        to_version: (args as any).target_version
      });
    }
  • Utility sleep function used for handling rate limiting (429 responses) in API calls.
    function sleep(ms: number) {
      return new Promise(resolve => setTimeout(resolve, ms));
    }
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 does not cover critical aspects like whether this is a read-only or mutative operation, error handling, rate limits, or output format. This leaves significant gaps in understanding the tool's behavior.

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 purpose without any extraneous information. It is front-loaded and wastes no words, making it highly concise and well-structured.

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 of a conversion tool with 3 undocumented parameters, no annotations, and no output schema, the description is inadequate. It fails to address behavioral traits, parameter details, or output expectations, leaving the agent poorly equipped to use the tool effectively.

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?

The input schema has 0% description coverage, so the description must compensate. It implies parameters for miRNA identifiers and versions but does not explain their semantics, such as format requirements, valid version strings, or array constraints. This adds minimal value beyond the bare schema.

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

Purpose5/5

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

The description clearly states the specific action ('Convert') and resource ('miRNA identifiers between miRBase versions'), distinguishing it from sibling tools like 'mirna_precursor_converter' which handles different conversions. It precisely communicates the tool's function without redundancy.

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, such as 'mirna_precursor_converter' or other sibling tools. It lacks context about prerequisites, typical use cases, or exclusions, leaving the agent with minimal direction.

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