Skip to main content
Glama
milliomics

millimap-mcp

Official
by milliomics

apply_qc_filter

Set thresholds for minimum/maximum genes, minimum counts, and maximum mitochondrial percentage to filter the active dataset. The filtered subset replaces the data and remains revertible.

Instructions

Apply QC filters to the active dataset in MilliMap.

Replaces the active adata with the filtered subset and re-renders. The original can be restored via the in-app QC controls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_genesNo
max_genesNo
min_countsNo
max_mito_pctNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'apply_qc_filter'. It accepts min_genes, max_genes, min_counts, and max_mito_pct parameters with sensible defaults and delegates to the MilliMap desktop app via HTTP POST.
    @mcp.tool()
    def apply_qc_filter(
        min_genes: int = 200,
        max_genes: int = 6000,
        min_counts: int = 500,
        max_mito_pct: float = 20.0,
    ) -> str:
        """Apply QC filters to the active dataset in MilliMap.
    
        Replaces the active adata with the filtered subset and re-renders.
        The original can be restored via the in-app QC controls.
        """
        return _fmt_json(_post_tool("apply_qc_filter", {
            "min_genes": min_genes, "max_genes": max_genes,
            "min_counts": min_counts, "max_mito_pct": max_mito_pct,
        }))
  • _post_tool helper function that sends the tool name and arguments to the running MilliMap desktop app via HTTP POST to http://127.0.0.1:<port>/tool.
    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}"}
  • _fmt_json helper that serializes the response to a pretty-printed JSON string for the MCP response.
    def _fmt_json(payload: Any) -> str:
        return json.dumps(payload, indent=2, default=str)
  • The '@mcp.tool()' decorator registers 'apply_qc_filter' as an MCP tool with the FastMCP server instance on line 22.
    @mcp.tool()
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool replaces the active dataset (destructive action) and that re-rendering occurs, plus restoration via in-app controls. It could add details about permissions or side effects but is fairly transparent.

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 three sentences, front-loaded with purpose, and every sentence adds value. No redundant or extraneous information.

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?

Despite an output schema existing, the description lacks parameter context for all four parameters. Given zero schema description coverage, the description should compensate but fails to do so, leaving critical information missing for proper tool usage.

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%, and the description adds no meaning beyond parameter names and defaults. It does not explain what min_genes, max_genes, min_counts, or max_mito_pct represent, leaving the agent without necessary context for proper parameter selection.

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 tool applies QC filters to the active dataset in MilliMap, specifying the action and resource. It distinguishes from sibling tools that perform clustering, marker finding, or other analyses.

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 explains that the tool replaces the active adata with the filtered subset and mentions restoration via in-app controls. It provides clear context of use but does not explicitly state when not to use or compare to alternatives.

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