remove_fact
Remove a specific fact from a GO-CAM model by specifying the exact subject, predicate, and object.
Instructions
Remove a fact from a GO-CAM model.
You must specify the exact triple (subject, predicate, object) to remove.
Args: model_id: The GO-CAM model identifier subject_id: Subject of the fact object_id: Object of the fact predicate_id: Predicate of the fact
Returns: Barista API response
Examples: # Remove an enabled_by relationship remove_fact( "gomodel:12345", "gomodel:12345/mf_123", "gomodel:12345/gp_456", "RO:0002333" )
# Remove a causal relationship
remove_fact(
"gomodel:12345",
"gomodel:12345/activity1",
"gomodel:12345/activity2",
"RO:0002413" # provides input for
)
# Remove occurs_in relationship
remove_fact(
"gomodel:12345",
"gomodel:12345/mf_123",
"gomodel:12345/cc_789",
"BFO:0000066" # occurs_in
)
# Remove using variable references (within same batch)
remove_fact("gomodel:12345", "mf1", "gp1", "RO:0002333")Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes | ||
| subject_id | Yes | ||
| object_id | Yes | ||
| predicate_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/noctua_mcp/mcp_server.py:750-832 (handler)The remove_fact tool handler function. It takes model_id, subject_id, object_id, and predicate_id, calls client.remove_fact(), and returns success/failure with validation error handling.
@mcp.tool() async def remove_fact( model_id: str, subject_id: str, object_id: str, predicate_id: str ) -> Dict[str, Any]: """ Remove a fact from a GO-CAM model. You must specify the exact triple (subject, predicate, object) to remove. Args: model_id: The GO-CAM model identifier subject_id: Subject of the fact object_id: Object of the fact predicate_id: Predicate of the fact Returns: Barista API response Examples: # Remove an enabled_by relationship remove_fact( "gomodel:12345", "gomodel:12345/mf_123", "gomodel:12345/gp_456", "RO:0002333" ) # Remove a causal relationship remove_fact( "gomodel:12345", "gomodel:12345/activity1", "gomodel:12345/activity2", "RO:0002413" # provides input for ) # Remove occurs_in relationship remove_fact( "gomodel:12345", "gomodel:12345/mf_123", "gomodel:12345/cc_789", "BFO:0000066" # occurs_in ) # Remove using variable references (within same batch) remove_fact("gomodel:12345", "mf1", "gp1", "RO:0002333") """ client = get_client() resp = client.remove_fact(model_id, subject_id, object_id, predicate_id) if resp.validation_failed: return { "success": False, "error": "Validation failed", "reason": resp.validation_reason, "rolled_back": True, "fact": { "subject": subject_id, "predicate": predicate_id, "object": object_id }, "model_id": model_id } if resp.error: return { "success": False, "error": resp.error, "fact": { "subject": subject_id, "predicate": predicate_id, "object": object_id }, "model_id": model_id } # Return minimal success response return { "success": True, "removed": True } - src/noctua_mcp/mcp_server.py:750-750 (registration)The tool is registered via the @mcp.tool() decorator on line 750, which registers remove_fact with the FastMCP server instance.
@mcp.tool() - src/noctua_mcp/mcp_server.py:56-61 (helper)The get_client() helper function that creates/lazily initializes the BaristaClient instance used by remove_fact to call client.remove_fact().
def get_client() -> BaristaClient: """Get or create the Barista client instance.""" global _client if _client is None: _client = BaristaClient() return _client - src/noctua_mcp/mcp_server.py:751-755 (schema)Input schema for remove_fact: model_id (str), subject_id (str), object_id (str), predicate_id (str) defined via FastMCP type annotations.
async def remove_fact( model_id: str, subject_id: str, object_id: str, predicate_id: str