get_model
Retrieve complete GO-CAM model data including individuals, facts, and annotations using the model identifier to access biological pathway information.
Instructions
Retrieve the full JSON representation of a GO-CAM model.
Args: model_id: The GO-CAM model identifier
Returns: Full model data including individuals and facts
Examples: # Get a production model model = get_model("gomodel:5fce9b7300001215") # Returns complete model with: # - data.id: model ID # - data.individuals: list of all individuals # - data.facts: list of all relationships # - data.annotations: model-level annotations
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes |
Input Schema (JSON Schema)
Implementation Reference
- src/noctua_mcp/mcp_server.py:836-892 (handler)The handler function for the 'get_model' MCP tool. Decorated with @mcp.tool(), it calls BaristaClient.get_model(model_id), processes the response, and returns a structured dictionary with model data (individuals, facts, annotations, state) or error information.async def get_model(model_id: str) -> Dict[str, Any]: """ Retrieve the full JSON representation of a GO-CAM model. Args: model_id: The GO-CAM model identifier Returns: Full model data including individuals and facts Examples: # Get a production model model = get_model("gomodel:5fce9b7300001215") # Returns complete model with: # - data.id: model ID # - data.individuals: list of all individuals # - data.facts: list of all relationships # - data.annotations: model-level annotations # Extract specific information model = get_model("gomodel:12345") individuals = model["data"]["individuals"] facts = model["data"]["facts"] # Find all molecular functions mfs = [i for i in individuals if any("GO:0003674" in str(e.id) for e in i.type if hasattr(e, 'id'))] # Find all enabled_by relationships (facts are Pydantic objects) enabled_by = [f for f in facts if f.property == "RO:0002333"] # Check model state state = model["data"].get("state") """ client = get_client() resp = client.get_model(model_id) if resp.error: return { "success": False, "error": resp.error, "model_id": model_id } # Return structured response with model data return { "success": True, "model_id": model_id, "data": { "individuals": resp.individuals, "facts": resp.facts, "annotations": resp.annotations if hasattr(resp, 'annotations') else [], "state": resp.model_state if hasattr(resp, 'model_state') else None }, "raw": resp.raw # Include raw for backward compatibility }