add_evidence_to_fact
Add evidence to existing facts in GO-CAM models by specifying evidence codes and source references to support biological assertions.
Instructions
Add evidence to an existing fact in a GO-CAM model.
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 eco_id: Evidence code (e.g., "ECO:0000353") sources: List of source references (e.g., ["PMID:12345"]) with_from: Optional list of with/from references
Returns: Barista API response
Examples: # Add experimental evidence from a paper add_evidence_to_fact( "gomodel:12345", "mf1", "gp1", "RO:0002333", "ECO:0000353", # physical interaction evidence ["PMID:12345678"] )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes | ||
| subject_id | Yes | ||
| object_id | Yes | ||
| predicate_id | Yes | ||
| eco_id | Yes | ||
| sources | Yes | ||
| with_from | No |
Input Schema (JSON Schema)
Implementation Reference
- src/noctua_mcp/mcp_server.py:338-437 (handler)The primary handler function for the 'add_evidence_to_fact' MCP tool. Decorated with @mcp.tool(), it implements the core logic: resolves the fact triple, generates requests via BaristaClient.req_add_evidence_to_fact, executes a batch operation, and handles validation/errors with rollback support. The function signature and docstring define the input schema and usage examples.@mcp.tool() async def add_evidence_to_fact( model_id: str, subject_id: str, object_id: str, predicate_id: str, eco_id: str, sources: List[str], with_from: Optional[List[str]] = None ) -> Dict[str, Any]: """ Add evidence to an existing fact in a GO-CAM model. 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 eco_id: Evidence code (e.g., "ECO:0000353") sources: List of source references (e.g., ["PMID:12345"]) with_from: Optional list of with/from references Returns: Barista API response Examples: # Add experimental evidence from a paper add_evidence_to_fact( "gomodel:12345", "mf1", "gp1", "RO:0002333", "ECO:0000353", # physical interaction evidence ["PMID:12345678"] ) # Add multiple sources add_evidence_to_fact( "gomodel:12345", "mf1", "gp1", "RO:0002333", "ECO:0000314", # direct assay evidence ["PMID:12345678", "PMID:87654321", "doi:10.1234/example"] ) # Add evidence with with/from (e.g., for IPI) add_evidence_to_fact( "gomodel:12345", "mf1", "gp1", "RO:0002333", "ECO:0000353", # IPI ["PMID:12345678"], ["UniProtKB:Q9Y6K9", "UniProtKB:P38398"] # interacting partners ) # Common evidence codes: # ECO:0000314 - direct assay evidence # ECO:0000353 - physical interaction evidence (IPI) # ECO:0000315 - mutant phenotype evidence (IMP) # ECO:0000316 - genetic interaction evidence (IGI) # ECO:0000318 - biological aspect of ancestor evidence (IBA) # ECO:0000269 - experimental evidence """ client = get_client() reqs = client.req_add_evidence_to_fact( model_id, subject_id, object_id, predicate_id, eco_id, sources, with_from ) resp = client.m3_batch(reqs) 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 }, "evidence": { "eco_id": eco_id, "sources": sources, "with_from": with_from } } if resp.error: return { "success": False, "error": resp.error, "model_id": model_id, "fact": { "subject": subject_id, "predicate": predicate_id, "object": object_id } } # Return minimal success response return { "success": True, "evidence_added": True, "eco_id": eco_id }
- src/noctua_mcp/mcp_server.py:395-437 (helper)Invocation of the underlying BaristaClient helper method req_add_evidence_to_fact, which generates the actual API requests for adding evidence. This is the lowest-level implementation detail visible in the codebase.reqs = client.req_add_evidence_to_fact( model_id, subject_id, object_id, predicate_id, eco_id, sources, with_from ) resp = client.m3_batch(reqs) 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 }, "evidence": { "eco_id": eco_id, "sources": sources, "with_from": with_from } } if resp.error: return { "success": False, "error": resp.error, "model_id": model_id, "fact": { "subject": subject_id, "predicate": predicate_id, "object": object_id } } # Return minimal success response return { "success": True, "evidence_added": True, "eco_id": eco_id }
- src/noctua_mcp/mcp_server.py:338-338 (registration)The @mcp.tool() decorator registers the add_evidence_to_fact function as an MCP tool with FastMCP.@mcp.tool()