Skip to main content
Glama

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

# 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")

Input Schema

NameRequiredDescriptionDefault
model_idYes

Input Schema (JSON Schema)

{ "properties": { "model_id": { "type": "string" } }, "required": [ "model_id" ], "type": "object" }

Implementation Reference

  • 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 }

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/geneontology/noctua-mcp'

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