Skip to main content
Glama
geneontology

Noctua MCP Server

Official
by geneontology

get_model_variables

Retrieve bound variable mappings for GO-CAM models to identify available individual IDs after batch operations, enabling cross-batch workflow continuity.

Instructions

Get the currently bound variables for a GO-CAM model.

Returns a mapping of variable names to their actual individual IDs. This is useful for understanding what variables are available in the current model context, especially after batch operations.

Args: model_id: The GO-CAM model identifier

Returns: Dictionary with variable mappings and model information

Examples: # Get variables after creating individuals vars = get_model_variables("gomodel:12345") # Returns: # { # "model_id": "gomodel:12345", # "variables": { # "mf1": "gomodel:12345/68dee4d300000481", # "gp1": "gomodel:12345/68dee4d300000482", # "cc1": "gomodel:12345/68dee4d300000483" # }, # "individual_count": 3 # }

# Use the variables in subsequent operations
vars = get_model_variables("gomodel:12345")
mf_id = vars["variables"]["mf1"]
add_fact("gomodel:12345", mf_id, vars["variables"]["gp1"], "RO:0002333")

Notes: - Variables are only valid within the same batch operation - This tool helps identify actual IDs for cross-batch operations - If the model has no tracked variables, returns empty dict

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_model_variables' MCP tool. It retrieves variable mappings (variable names to actual individual IDs) for a GO-CAM model by accessing the BaristaClient's variable registry and recent model responses. Includes error handling and individual count.
    async def get_model_variables(model_id: str) -> Dict[str, Any]:
        """
        Get the currently bound variables for a GO-CAM model.
    
        Returns a mapping of variable names to their actual individual IDs.
        This is useful for understanding what variables are available in the
        current model context, especially after batch operations.
    
        Args:
            model_id: The GO-CAM model identifier
    
        Returns:
            Dictionary with variable mappings and model information
    
        Examples:
            # Get variables after creating individuals
            vars = get_model_variables("gomodel:12345")
            # Returns:
            # {
            #   "model_id": "gomodel:12345",
            #   "variables": {
            #     "mf1": "gomodel:12345/68dee4d300000481",
            #     "gp1": "gomodel:12345/68dee4d300000482",
            #     "cc1": "gomodel:12345/68dee4d300000483"
            #   },
            #   "individual_count": 3
            # }
    
            # Use the variables in subsequent operations
            vars = get_model_variables("gomodel:12345")
            mf_id = vars["variables"]["mf1"]
            add_fact("gomodel:12345", mf_id, vars["variables"]["gp1"], "RO:0002333")
    
        Notes:
            - Variables are only valid within the same batch operation
            - This tool helps identify actual IDs for cross-batch operations
            - If the model has no tracked variables, returns empty dict
        """
        client = get_client()
    
        # Check if the client has variable tracking enabled
        if not hasattr(client, 'track_variables') or not client.track_variables:
            client.track_variables = True
    
        # Get the model to see current state
        resp = client.get_model(model_id)
    
        if resp.error:
            return {
                "success": False,
                "error": resp.error,
                "model_id": model_id
            }
    
        # Get variables from the client's registry
        variables = {}
        if hasattr(client, '_variable_registry') and client._variable_registry:
            # The registry is keyed by (model_id, variable_name) -> actual_id
            # We need to extract variables for this specific model
            variables = client.get_variables(model_id)
    
        # Also check if the last response has model_vars
        if hasattr(resp, 'model_vars') and resp.model_vars:
            variables.update(resp.model_vars)
    
        # Count individuals
        individual_count = len(resp.individuals) if resp.individuals else 0
    
        return {
            "success": True,
            "model_id": model_id,
            "variables": variables,
            "individual_count": individual_count,
        }
Behavior4/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 effectively describes key behaviors: the return format (dictionary with variable mappings), what happens in edge cases ('If the model has no tracked variables, returns empty dict'), and important constraints about variable validity ('Variables are only valid within the same batch operation'). It doesn't mention error conditions or rate limits, but covers the essential operational behavior.

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

Conciseness5/5

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

The description is well-structured with clear sections (purpose, returns, examples, notes), front-loaded with the core functionality, and every sentence adds value. The examples are comprehensive but necessary to demonstrate the tool's utility in the broader workflow.

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

Completeness5/5

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

Given the tool's moderate complexity, no annotations, and the presence of an output schema (which handles return value documentation), the description provides complete context. It covers purpose, usage scenarios, parameter meaning, return format through examples, and important behavioral notes about variable validity and edge cases.

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

Parameters4/5

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

The schema has 0% description coverage for its single parameter, but the description compensates by explaining that 'model_id' is 'The GO-CAM model identifier' and showing its usage in examples. While it doesn't provide format details beyond what the examples imply, it adds meaningful context about what this parameter represents in the GO-CAM context.

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 tool's purpose with specific verb ('Get') and resource ('currently bound variables for a GO-CAM model'), and distinguishes it from siblings like 'get_model' or 'model_summary' by focusing specifically on variable mappings rather than general model information or summaries.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('useful for understanding what variables are available in the current model context, especially after batch operations') and provides concrete examples showing how to use the returned variables in subsequent operations with sibling tools like 'add_fact'. It also specifies when variables are valid ('only valid within the same batch operation').

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