Skip to main content
Glama
milliomics

millimap-mcp

Official
by milliomics

run_millimap_tool

Run any of MilliMap's 30+ analysis tools by name with custom arguments.

Instructions

Escape hatch — run any of MilliMap's 30+ analysis tools by name.

Use when a workflow needs a tool not individually exposed above.

Examples of tool_name: run_deg_clusters, run_deg_roi, run_go_enrichment, find_spatially_variable_genes, run_neighborhood_enrichment, run_co_occurrence, run_centrality_scores, run_interaction_matrix, run_ripley, run_ligrec, run_pca, run_louvain, run_diffmap, run_draw_graph, run_paga, run_dpt, run_embedding_density, run_doublet_detection, normalize_data, find_highly_variable_genes, score_cell_cycle, create_dotplot, create_heatmap, create_stacked_violin, annotate_clusters.

Args: tool_name: Exact tool name from the list above. tool_args_json: JSON string of arguments, e.g. '{"group_a": "1", "group_b": "2"}'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_nameYes
tool_args_jsonNo{}

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'run_millimap_tool' tool. It parses a JSON string of arguments, then delegates to _post_tool with the inner tool name and args.
    @mcp.tool()
    def run_millimap_tool(tool_name: str, tool_args_json: str = "{}") -> str:
        """Escape hatch — run any of MilliMap's 30+ analysis tools by name.
    
        Use when a workflow needs a tool not individually exposed above.
    
        Examples of tool_name:
            run_deg_clusters, run_deg_roi, run_go_enrichment,
            find_spatially_variable_genes, run_neighborhood_enrichment,
            run_co_occurrence, run_centrality_scores, run_interaction_matrix,
            run_ripley, run_ligrec, run_pca, run_louvain, run_diffmap,
            run_draw_graph, run_paga, run_dpt, run_embedding_density,
            run_doublet_detection, normalize_data, find_highly_variable_genes,
            score_cell_cycle, create_dotplot, create_heatmap,
            create_stacked_violin, annotate_clusters.
    
        Args:
            tool_name: Exact tool name from the list above.
            tool_args_json: JSON string of arguments, e.g. '{"group_a": "1", "group_b": "2"}'.
        """
        try:
            inner = json.loads(tool_args_json) if tool_args_json else {}
        except Exception as exc:
            return _fmt_json({"ok": False, "error": f"bad tool_args_json: {exc}"})
        return _fmt_json(_post_tool("run_tool", {
            "tool_name": tool_name, "tool_args": inner,
        }))
  • Helper function _post_tool that sends the actual HTTP POST request to the MilliMap desktop application endpoint (http://host:port/tool). Used by run_millimap_tool to proxy the tool execution.
    def _post_tool(name: str, args: dict, timeout: float = 600.0) -> dict:
        ctrl = _load_control()
        if not ctrl or not ctrl.get("port"):
            return {
                "ok": False,
                "error": (
                    f"MilliMap control endpoint not found at {CONTROL_PATH}. "
                    "Make sure MilliMap is running with a dataset loaded."
                ),
            }
        host = ctrl.get("host", "127.0.0.1")
        port = int(ctrl["port"])
        url = f"http://{host}:{port}/tool"
        data = json.dumps({"name": name, "args": args}).encode("utf-8")
        req = urllib.request.Request(
            url, data=data,
            headers={"Content-Type": "application/json"},
            method="POST",
        )
        try:
            with urllib.request.urlopen(req, timeout=timeout) as resp:
                return json.loads(resp.read().decode("utf-8"))
        except urllib.error.URLError as exc:
            return {"ok": False, "error": f"connection failed: {exc.reason}"}
        except Exception as exc:
            return {"ok": False, "error": f"HTTP call failed: {exc}"}
  • Helper function _fmt_json that serializes the response payload to a pretty-printed JSON string.
    def _fmt_json(payload: Any) -> str:
        return json.dumps(payload, indent=2, default=str)
  • Registration of the tool via the @mcp.tool() decorator on the run_millimap_tool function, which exposes it as an MCP tool named 'run_millimap_tool'.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as read-only/write, error handling, or side effects. It only lists tool names and gives an arg example, leaving the agent uninformed about runtime 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 extremely concise with a clear header, usage line, and a list of examples. Every sentence adds value, and the structure is front-loaded with the purpose.

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

Completeness4/5

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

Given the tool's complexity (30+ sub-tools) and the presence of an output schema, the description covers the essential purpose and usage. It could be improved by adding error handling notes or more details on tool_args_json format, but it is largely complete.

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?

Schema description coverage is 0%, but the description compensates by listing valid tool_name examples and providing a JSON example for tool_args_json. However, it does not fully explain the expected structure of tool_args_json beyond the single example.

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 it is an 'Escape hatch' to run any of MilliMap's 30+ analysis tools by name, with a long list of examples. This distinctively separates it from sibling tools which are specific tools.

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

Usage Guidelines4/5

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

The description says 'Use when a workflow needs a tool not individually exposed above,' providing explicit context for when to use. It lacks explicit alternatives but the sibling list naturally serves that purpose.

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/milliomics/millimap-mcp'

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