Skip to main content
Glama
milliomics

millimap-mcp

Official
by milliomics

get_analysis_card

Retrieve the full data of an analysis card, including its underlying DataFrame, to inspect numerical results such as differential expression tables, p-values, and z-scores.

Instructions

Fetch the full payload of one analysis result card, including its underlying DataFrame (up to max_rows rows, default 50).

Use this to inspect the actual numbers behind a card — e.g. the differential expression table, spatial autocorrelation p-values, neighborhood enrichment z-scores — so you can reason over the result.

Args: card_id: The id field from list_analysis_cards (a hex token). max_rows: Max rows of the DataFrame to include (1–500, default 50).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
card_idYes
max_rowsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual get_analysis_card tool handler. It accepts card_id and max_rows, then delegates to _post_tool('get_card_detail', ...) to fetch the full payload from the MilliMap desktop app via HTTP POST.
    def get_analysis_card(card_id: str, max_rows: int = 50) -> str:
        """Fetch the full payload of one analysis result card, including its
        underlying DataFrame (up to ``max_rows`` rows, default 50).
    
        Use this to inspect the actual numbers behind a card — e.g. the
        differential expression table, spatial autocorrelation p-values,
        neighborhood enrichment z-scores — so you can reason over the result.
    
        Args:
            card_id: The ``id`` field from ``list_analysis_cards`` (a hex token).
            max_rows: Max rows of the DataFrame to include (1–500, default 50).
        """
        return _fmt_json(_post_tool("get_card_detail", {
            "card_id": card_id,
            "max_rows": max_rows,
        }))
  • The @mcp.tool() decorator registers get_analysis_card as an MCP tool on the FastMCP server instance.
    @mcp.tool()
    def get_analysis_card(card_id: str, max_rows: int = 50) -> str:
  • Input parameters: card_id (str, required) and max_rows (int, optional, default 50, range 1-500). Returns a JSON string via _fmt_json.
    Args:
        card_id: The ``id`` field from ``list_analysis_cards`` (a hex token).
        max_rows: Max rows of the DataFrame to include (1–500, default 50).
    """
    return _fmt_json(_post_tool("get_card_detail", {
        "card_id": card_id,
        "max_rows": max_rows,
    }))
  • _post_tool helper function that sends the tool call (including 'get_card_detail' used by get_analysis_card) via HTTP POST to the MilliMap desktop app's /tool endpoint.
    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 used by get_analysis_card to serialize the response payload to a pretty-printed JSON string.
    def _fmt_json(payload: Any) -> str:
        return json.dumps(payload, indent=2, default=str)
Behavior4/5

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

With no annotations provided, the description discloses key behavioral traits: it returns a DataFrame up to max_rows rows (default 50). It does not mention any side effects, but as a read operation, the disclosure is adequate. No contradiction with annotations.

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 concise and well-structured. It starts with a clear one-sentence purpose, followed by examples and parameter explanations. No redundant or extraneous text.

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 no annotations and the presence of an output schema, the description adequately covers the return value (DataFrame with rows). It provides sufficient context for an agent to use the tool effectively, though it could briefly mention that the output schema details are available.

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

Parameters5/5

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

Schema description coverage is 0%, so the description adds essential meaning: card_id is a hex token from list_analysis_cards, and max_rows limits rows (1–500, default 50). This goes well beyond the schema's minimal type info.

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 fetches the full payload of one analysis result card, including the underlying DataFrame. It distinguishes from siblings (e.g., list_analysis_cards) by focusing on fetching a single card's full data.

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 provides clear usage context: it is used to inspect the actual numbers behind a card (e.g., tables, p-values). It mentions using the id from list_analysis_cards but does not explicitly exclude when not to use this tool or mention alternatives, though the context is clear.

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