Skip to main content
Glama
geneontology

Noctua MCP Server

Official
by geneontology

add_fact

Add a semantic relation (fact) between two individuals in a GO-CAM model by specifying subject, object, and predicate identifiers.

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

  • Registration of the add_fact MCP tool via @mcp.tool() decorator
    @mcp.tool()
    async def add_fact(
  • Handler implementation for the add_fact tool: adds a fact (edge) between two individuals in a GO-CAM model. Resolves variables, calls req_add_fact, executes via m3_batch, and returns success/error response.
    @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
        }
Behavior2/5

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

No annotations are provided, so the description must convey behavioral traits. It mentions 'Add a fact' and provides examples, but does not disclose whether facts can be duplicated, whether the operation is idempotent, or what happens on conflict. The return value is vaguely described as 'Barista API response'.

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 first sentence clearly states the purpose, but the description is overly long with many repetitive examples. It could be more concise by summarizing common patterns instead of listing many specific cases.

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

Completeness3/5

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

The description covers many use cases through examples but does not mention error handling, the effect of existing facts, or details about the output schema (which exists but is not described). It provides enough for common scenarios but lacks completeness.

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?

The input schema has 0% description coverage, but the description compensates with extensive examples showing valid parameter values, especially for predicate_id with many RO identifiers. This adds significant meaning 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 'Add a fact (edge/relation) between two individuals in a model', using a specific verb and resource. It distinguishes from sibling tools like 'add_individual' and 'remove_fact' through examples and the nature of the operation.

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

Usage Guidelines2/5

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

The description does not explicitly state when to use this tool versus alternatives (e.g., 'remove_fact' or 'add_evidence_to_fact'). It provides examples but no context about prerequisites, conditions, or when not to use it.

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