Skip to main content
Glama
geneontology

Noctua MCP Server

Official
by geneontology

add_fact

Add relationships between biological entities in GO-CAM models to represent molecular functions, cellular components, biological processes, and regulatory interactions.

Instructions

Add a fact (edge/relation) between two individuals in a model.

Args: model_id: The GO-CAM model identifier subject_id: Subject individual ID or variable object_id: Object individual ID or variable predicate_id: Relation predicate (e.g., "RO:0002333" for enabled_by)

Returns: Barista API response

Examples: # Connect molecular function to gene product (enabled_by) add_fact("gomodel:12345", "mf1", "gp1", "RO:0002333")

# Connect molecular function to cellular component (occurs_in)
add_fact("gomodel:12345", "mf1", "cc1", "BFO:0000066")

# Connect molecular function to biological process (part_of)
add_fact("gomodel:12345", "mf1", "bp1", "BFO:0000050")

# Add causal relationship between activities
add_fact("gomodel:12345", "mf1", "mf2", "RO:0002411")  # causally upstream of
add_fact("gomodel:12345", "mf1", "mf2", "RO:0002629")  # directly positively regulates
add_fact("gomodel:12345", "mf1", "mf2", "RO:0002630")  # directly negatively regulates
add_fact("gomodel:12345", "mf1", "mf2", "RO:0002413")  # provides input for

# Add regulates relationships
add_fact("gomodel:12345", "mf1", "bp1", "RO:0002211")  # regulates
add_fact("gomodel:12345", "mf1", "bp1", "RO:0002213")  # positively regulates
add_fact("gomodel:12345", "mf1", "bp1", "RO:0002212")  # negatively regulates

# Add indirect regulation relationships
add_fact("gomodel:12345", "mf1", "mf2", "RO:0002407")  # indirectly positively regulates
add_fact("gomodel:12345", "mf1", "mf2", "RO:0002409")  # indirectly negatively regulates

# Add causal relationships with effects
add_fact("gomodel:12345", "mf1", "mf2", "RO:0002304")  # causally upstream of, positive effect
add_fact("gomodel:12345", "mf1", "mf2", "RO:0002305")  # causally upstream of, negative effect

# Add small molecule regulation relationships
add_fact("gomodel:12345", "sm1", "mf1", "RO:0012005")  # is small molecule activator of
add_fact("gomodel:12345", "sm1", "mf1", "RO:0012006")  # is small molecule inhibitor of

# Use with existing individual IDs from model
add_fact("gomodel:12345", "gomodel:12345/abc123", "gomodel:12345/def456", "RO:0002333")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYes
subject_idYes
object_idYes
predicate_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler for the 'add_fact' MCP tool. It resolves subject/object identifiers using BaristaClient._resolve_identifier, constructs a req_add_fact request, executes it via m3_batch, handles validation errors with rollback info, and returns success/failure responses.
    @mcp.tool()
    async def add_fact(
        model_id: str,
        subject_id: str,
        object_id: str,
        predicate_id: str
    ) -> Dict[str, Any]:
        """
        Add a fact (edge/relation) between two individuals in a model.
    
        Args:
            model_id: The GO-CAM model identifier
            subject_id: Subject individual ID or variable
            object_id: Object individual ID or variable
            predicate_id: Relation predicate (e.g., "RO:0002333" for enabled_by)
    
        Returns:
            Barista API response
    
        Examples:
            # Connect molecular function to gene product (enabled_by)
            add_fact("gomodel:12345", "mf1", "gp1", "RO:0002333")
    
            # Connect molecular function to cellular component (occurs_in)
            add_fact("gomodel:12345", "mf1", "cc1", "BFO:0000066")
    
            # Connect molecular function to biological process (part_of)
            add_fact("gomodel:12345", "mf1", "bp1", "BFO:0000050")
    
            # Add causal relationship between activities
            add_fact("gomodel:12345", "mf1", "mf2", "RO:0002411")  # causally upstream of
            add_fact("gomodel:12345", "mf1", "mf2", "RO:0002629")  # directly positively regulates
            add_fact("gomodel:12345", "mf1", "mf2", "RO:0002630")  # directly negatively regulates
            add_fact("gomodel:12345", "mf1", "mf2", "RO:0002413")  # provides input for
    
            # Add regulates relationships
            add_fact("gomodel:12345", "mf1", "bp1", "RO:0002211")  # regulates
            add_fact("gomodel:12345", "mf1", "bp1", "RO:0002213")  # positively regulates
            add_fact("gomodel:12345", "mf1", "bp1", "RO:0002212")  # negatively regulates
    
            # Add indirect regulation relationships
            add_fact("gomodel:12345", "mf1", "mf2", "RO:0002407")  # indirectly positively regulates
            add_fact("gomodel:12345", "mf1", "mf2", "RO:0002409")  # indirectly negatively regulates
    
            # Add causal relationships with effects
            add_fact("gomodel:12345", "mf1", "mf2", "RO:0002304")  # causally upstream of, positive effect
            add_fact("gomodel:12345", "mf1", "mf2", "RO:0002305")  # causally upstream of, negative effect
    
            # Add small molecule regulation relationships
            add_fact("gomodel:12345", "sm1", "mf1", "RO:0012005")  # is small molecule activator of
            add_fact("gomodel:12345", "sm1", "mf1", "RO:0012006")  # is small molecule inhibitor of
    
            # Use with existing individual IDs from model
            add_fact("gomodel:12345", "gomodel:12345/abc123", "gomodel:12345/def456", "RO:0002333")
        """
        client = get_client()
    
        # Resolve any variables to actual IDs
        resolved_subject = client._resolve_identifier(model_id, subject_id)
        resolved_object = client._resolve_identifier(model_id, object_id)
    
        req = client.req_add_fact(model_id, resolved_subject, resolved_object, predicate_id)
        resp = client.m3_batch([req])
    
        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
                }
            }
    
        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,
            "fact_added": True
        }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly indicates this is a write operation ('Add'), but doesn't mention permission requirements, whether the operation is idempotent, error conditions, or rate limits. The examples show various use cases but don't explain behavioral constraints beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (description, Args, Returns, Examples), but the examples section is extremely long with 17 examples - many of which could be consolidated or represented more concisely. While informative, the length reduces scanability and some examples are redundant in demonstrating the same pattern.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a mutation tool with no annotations, 4 parameters at 0% schema coverage, but with an output schema present, the description does an excellent job explaining parameters and usage through examples. The main gap is lack of behavioral context about permissions, errors, or side effects. The output schema handles return values, so the description appropriately focuses on usage rather than output format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing detailed parameter explanations in the 'Args' section and extensive examples showing exactly how each parameter should be used. The examples demonstrate various valid values for predicate_id and show both variable names and full IDs for subject_id/object_id, adding significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Add a fact') and resource ('between two individuals in a model'), distinguishing it from siblings like 'add_individual' (adds individuals) and 'remove_fact' (removes facts). The opening sentence provides a precise verb+resource combination that immediately communicates the tool's function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool through extensive examples showing various relationship types (enabled_by, occurs_in, regulates, etc.). However, it doesn't explicitly state when NOT to use it or mention direct alternatives like 'remove_fact' for deletion operations, which would be helpful for sibling differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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