create_model
Create a new GO-CAM model for representing biological pathways and processes, providing a foundation for adding genes, functions, and causal relationships in the Noctua MCP Server.
Instructions
Create a new empty GO-CAM model.
Args: title: Optional title for the model
Returns: Barista API response containing the new model ID and editor URLs
Examples:
create_model("RAS-RAF signaling pathway")
Notes: - The returned model_id can be used with other tools like add_individual - Models are created in "development" state by default - To add taxon information, use add_individual after creating the model
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No |
Implementation Reference
- src/noctua_mcp/mcp_server.py:91-153 (handler)The handler function decorated with @mcp.tool() that implements the create_model tool logic. It uses BaristaClient to create a new GO-CAM model, handles responses, validation errors, and constructs editor URLs.@mcp.tool() async def create_model( title: Optional[str] = None ) -> Dict[str, Any]: """ Create a new empty GO-CAM model. Args: title: Optional title for the model Returns: Barista API response containing the new model ID and editor URLs Examples: - `create_model("RAS-RAF signaling pathway")` Notes: - The returned model_id can be used with other tools like add_individual - Models are created in "development" state by default - To add taxon information, use add_individual after creating the model """ client = get_client() resp = client.create_model(title=title) if resp.validation_failed: return { "success": False, "error": "Validation failed", "reason": resp.validation_reason, "rolled_back": True } if resp.error: return { "success": False, "error": "Operation failed", "reason": resp.error } # Build minimal response result = { "success": True, "model_id": resp.model_id, "created": True } # Add editor URLs if we have a model ID if resp.model_id: import os token = os.environ.get("BARISTA_TOKEN", "") # Graph editor with token result["graph_editor_url"] = f"http://noctua-dev.berkeleybop.org/editor/graph/{resp.model_id}?barista_token={token}" # Pathway editor without token (URL encoded model ID) from urllib.parse import quote encoded_id = quote(resp.model_id, safe="") result["pathway_editor_url"] = f"http://noctua-dev.berkeleybop.org/workbench/noctua-visual-pathway-editor/?model_id={encoded_id}" return result