remove_individual
Remove an individual from a GO-CAM model along with all connected facts to maintain model integrity during biological knowledge representation editing.
Instructions
Remove an individual from a GO-CAM model.
Note: This will also remove all facts (edges) connected to this individual.
Args: model_id: The GO-CAM model identifier individual_id: The individual to remove
Returns: Barista API response
Examples: # Remove using a variable reference (within same batch) remove_individual("gomodel:12345", "mf1")
# Remove using full individual ID
remove_individual("gomodel:12345", "gomodel:12345/5fce9b7300001215")
# Remove an evidence individual
remove_individual("gomodel:12345", "gomodel:12345/evidence_123")
# Clean up after testing
for ind_id in ["test1", "test2", "test3"]:
remove_individual("gomodel:12345", ind_id)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes | ||
| individual_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"individual_id": {
"type": "string"
},
"model_id": {
"type": "string"
}
},
"required": [
"model_id",
"individual_id"
],
"type": "object"
}
Implementation Reference
- src/noctua_mcp/mcp_server.py:690-747 (handler)The MCP tool handler for 'remove_individual'. This async function implements the core logic: it retrieves the BaristaClient, calls client.remove_individual(model_id, individual_id) to perform the removal (which also removes connected facts), handles validation and error responses, and returns a standardized success/error dictionary.@mcp.tool() async def remove_individual( model_id: str, individual_id: str ) -> Dict[str, Any]: """ Remove an individual from a GO-CAM model. Note: This will also remove all facts (edges) connected to this individual. Args: model_id: The GO-CAM model identifier individual_id: The individual to remove Returns: Barista API response Examples: # Remove using a variable reference (within same batch) remove_individual("gomodel:12345", "mf1") # Remove using full individual ID remove_individual("gomodel:12345", "gomodel:12345/5fce9b7300001215") # Remove an evidence individual remove_individual("gomodel:12345", "gomodel:12345/evidence_123") # Clean up after testing for ind_id in ["test1", "test2", "test3"]: remove_individual("gomodel:12345", ind_id) """ client = get_client() resp = client.remove_individual(model_id, individual_id) if resp.validation_failed: return { "success": False, "error": "Validation failed", "reason": resp.validation_reason, "rolled_back": True, "individual_id": individual_id, "model_id": model_id } if resp.error: return { "success": False, "error": resp.error, "individual_id": individual_id, "model_id": model_id } # Return minimal success response return { "success": True, "removed": True, "individual_id": individual_id }