list_analysis_cards
Retrieve a summary list of analysis result cards from the MilliMap workspace sidebar. Get an overview of available cards without loading full details.
Instructions
List the analysis result cards visible in MilliMap's workspace sidebar.
Same data as the millimap://analysis_cards resource — returns an
array of summaries. Use get_analysis_card to load the full payload
for a specific card.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/millimap_mcp/server.py:225-233 (handler)The `list_analysis_cards()` function is decorated with @mcp.tool() — it returns a JSON-formatted list of analysis result cards from the MilliMap session snapshot by reading the "analysis_cards" key.
@mcp.tool() def list_analysis_cards() -> str: """List the analysis result cards visible in MilliMap's workspace sidebar. Same data as the ``millimap://analysis_cards`` resource — returns an array of summaries. Use ``get_analysis_card`` to load the full payload for a specific card. """ return _fmt_json(_load_snapshot().get("analysis_cards", [])) - src/millimap_mcp/server.py:124-133 (helper)The `analysis_cards_resource()` function provides the same data as a resource (millimap://analysis_cards), using the same _load_snapshot().get('analysis_cards', []) pattern.
@mcp.resource("millimap://analysis_cards") def analysis_cards_resource() -> str: """Analysis result cards shown in MilliMap's workspace sidebar. Each entry is a summary — title, type, method, timestamp, dataset, and dataframe shape if applicable. Use the ``get_analysis_card`` tool with the card's ``id`` to read its full payload (including the underlying DataFrame). """ return _fmt_json(_load_snapshot().get("analysis_cards", [])) - src/millimap_mcp/server.py:61-74 (helper)The `_load_snapshot()` helper reads and returns the full session JSON from ~/.millimap/mcp_session.json, handling missing files and parse errors.
def _load_snapshot() -> dict[str, Any]: if not SNAPSHOT_PATH.exists(): return { "error": "no_snapshot", "message": ( f"No MilliMap snapshot found at {SNAPSHOT_PATH}. " "Is MilliMap running with a dataset loaded?" ), } try: with SNAPSHOT_PATH.open("r") as f: return json.load(f) except Exception as exc: return {"error": "read_failed", "message": str(exc)} - src/millimap_mcp/server.py:77-78 (helper)The `_fmt_json()` helper serializes Python objects to indented JSON strings.
def _fmt_json(payload: Any) -> str: return json.dumps(payload, indent=2, default=str) - src/millimap_mcp/server.py:22-22 (registration)The `mcp` FastMCP instance used for the @mcp.tool() decorator that registers `list_analysis_cards`.
mcp = FastMCP("millimap")