Skip to main content
Glama
kkShrihari

miEAA3 MCP Server

by kkShrihari

over_representation_analysis

Perform over-representation analysis (ORA) to identify enriched miRNA or precursor categories in biological datasets using the miEAA platform.

Instructions

Run miEAA over-representation analysis (ORA) for miRNA or precursor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
speciesYes
entityYes
idsYes
category_selectionNo
reference_setNo
p_adjustNo
p_scopeNo
alphaNo
min_hitsNo

Implementation Reference

  • The OverRepresentationAnalysisHandler class provides the core implementation of the 'over_representation_analysis' tool. It includes validation, body building for API calls, category selection parsing, and the main 'run' method that orchestrates the miEAA over-representation analysis job submission and result retrieval.
    export class OverRepresentationAnalysisHandler {
    
      // -----------------------------------------------------
      // VALIDATION
      // -----------------------------------------------------
      validate(options: ORAOptions): string | null {
        if (!options.species) {
          return "species is required";
        }
    
        if (!["mirna", "precursor"].includes(options.entity)) {
          return "entity must be 'mirna' or 'precursor'";
        }
    
        if (!options.ids || !Array.isArray(options.ids) || options.ids.length === 0) {
          return "ids must be a non-empty array";
        }
    
        return null;
      }
    
      // -----------------------------------------------------
      // BUILD POST BODY (ORA ONLY)
      // -----------------------------------------------------
      buildBody(options: ORAOptions): any {
        const testset = options.ids.join(",");
    
        return {
          testset,
          categories: options.categories,
          reference: options.reference_set ?? [],
          p_adjust: options.p_adjust ?? "BH",
          adjust_scope: options.p_scope ?? "global",
          p_value: options.alpha ?? 0.05,
          min_hits: options.min_hits ?? 2
        };
      }
    
      // -----------------------------------------------------
      // PARSE CATEGORY SELECTION
      // -----------------------------------------------------
      parseCategorySelection(selection: string, categories: string[]): string[] {
        if (!selection || selection === "all") {
          return categories;
        }
    
        const chosen = new Set<string>();
        const parts = selection.split(",");
    
        for (let p of parts) {
          p = p.trim();
    
          if (p.includes("-")) {
            const [start, end] = p.split("-").map(n => parseInt(n.trim()));
            for (let i = start; i <= end; i++) {
              if (categories[i - 1]) chosen.add(categories[i - 1]);
            }
          } else {
            const num = parseInt(p);
            if (!isNaN(num) && categories[num - 1]) {
              chosen.add(categories[num - 1]);
            }
          }
        }
    
        return Array.from(chosen);
      }
    
      // -----------------------------------------------------
      // MAIN EXECUTION
      // -----------------------------------------------------
      async run(options: ORAOptions): Promise<any | MiEAAError> {
    
        // Validate
        const validationError = this.validate(options);
        if (validationError) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ success: false, error: validationError })
              }
            ],
            structuredContent: {
              success: false,
              error: validationError
            }
          };
        }
    
        // Auto-fetch categories if needed
        if (!options.categories || options.categories.length === 0) {
          const catRes = await fetchMiEAACategories(
            options.species,
            options.entity
          );
    
          if ("error" in catRes) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(catRes)
                }
              ],
              structuredContent: catRes
            };
          }
    
          options.categories = catRes.ids;
        }
    
        // Apply numeric category selection
        options.categories = this.parseCategorySelection(
          options.category_selection ?? "all",
          options.categories
        );
    
        // Build ORA body
        const body = this.buildBody(options);
    
        // Start ORA job (analysis_type is FIXED to ORA)
        const startJob: MiEAAStartResponse = await startMiEAAJob(
          body,
          options.species,
          options.entity,
          "ORA"
        );
    
        if ("error" in startJob) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(startJob)
              }
            ],
            structuredContent: startJob
          };
        }
    
        const jobId = startJob.job_id;
    
        // Log metadata to stderr (MCP-safe)
        console.error(`ORA job started: ${jobId}`);
        console.error(
          `Result URL: https://ccb-compute2.cs.uni-saarland.de/mieaa/api/v1/enrichment_analysis/results/${jobId}/`
        );
    
        // Fetch final ORA results
        const results = await fetchMiEAAResults(jobId);
    
        // Final MCP-compliant return
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(results)
            }
          ],
          structuredContent: results
        };
      }
    }
  • Type definitions for Entity and ORAOptions interface defining the input parameters for the over-representation analysis tool.
    type Entity = "mirna" | "precursor";
    
    interface ORAOptions {
      species: string;
      entity: Entity;
      ids: string[];
    
      category_selection?: string;
      categories?: string[];
    
      reference_set?: string[];
      p_adjust?: string;
      p_scope?: string;
      alpha?: number;
      min_hits?: number;
    }
  • src/server.ts:49-49 (registration)
    Instantiation of the OverRepresentationAnalysisHandler instance used for executing the tool.
    const oraTool = new OverRepresentationAnalysisHandler();
  • src/server.ts:193-195 (registration)
    Dispatch logic in the CallToolRequest handler that routes calls to 'over_representation_analysis' to the handler's run method.
    if (name === "over_representation_analysis") {
      return await oraTool.run(args as any);
    }
  • MCP tool schema registration in the ListTools response, defining name, description, and inputSchema for 'over_representation_analysis'.
      name: "over_representation_analysis",
      description: "Run miEAA over-representation analysis (ORA) for miRNA or precursor.",
      inputSchema: {
        type: "object",
        properties: {
          species: { type: "string" },
          entity: { type: "string", enum: ["mirna", "precursor"] },
          ids: { type: "array", items: { type: "string" } },
          category_selection: { type: "string" },
          reference_set: { type: "array", items: { type: "string" } },
          p_adjust: { type: "string" },
          p_scope: { type: "string" },
          alpha: { type: "number" },
          min_hits: { type: "number" }
        },
        required: ["species", "entity", "ids"]
      }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it indicates this is an analysis tool (likely non-destructive), it doesn't describe what the tool actually does behaviorally - whether it makes API calls, computes locally, has rate limits, requires authentication, returns specific data formats, or has any side effects. The description is too minimal for a 9-parameter tool with complex functionality.

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

Conciseness4/5

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

The description is extremely concise - a single sentence that gets straight to the point. While arguably too brief for such a complex tool, it's efficiently structured with zero wasted words. The front-loading is good, immediately stating the core functionality.

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?

For a complex bioinformatics analysis tool with 9 parameters, no annotations, no output schema, and 0% schema description coverage, this description is severely incomplete. It doesn't explain what ORA analysis entails, what results to expect, how to interpret parameters, or provide any context about the miEAA system. The agent would struggle to use this 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?

With 0% schema description coverage and 9 parameters (6 optional), the description provides no information about parameter meanings or usage. It mentions 'miRNA or precursor' which relates to the 'entity' parameter, but doesn't explain what 'species', 'ids', 'category_selection', 'reference_set', 'p_adjust', 'p_scope', 'alpha', or 'min_hits' represent or how they should be used.

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 action ('Run miEAA over-representation analysis (ORA)') and the target resources ('for miRNA or precursor'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate this tool from its siblings (list_enrichment_categories, mirbase_version_converter, mirna_precursor_converter), which appear to be related but distinct bioinformatics tools.

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 its siblings or alternatives. It mentions the analysis type (ORA) and target entities (miRNA/precursor), but doesn't specify use cases, prerequisites, or exclusions. This leaves the agent without context for tool selection.

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