Skip to main content
Glama
SethGame

FlexSim MCP Server

by SethGame

flexsim_get_node_value

Retrieve data from specific nodes in FlexSim simulation models to access parameters, statistics, and model states for analysis and automation.

Instructions

Get value from FlexSim tree node.

Args:
    node_path: Path to node (e.g., "Model/Queue1/stats/input")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler implementation for flexsim_get_node_value tool. Uses the @mcp.tool() decorator for registration, takes NodeAccessInput parameters, and retrieves values from FlexSim tree nodes using FlexScript's getvalue() function.
    @mcp.tool()
    async def flexsim_get_node_value(params: NodeAccessInput) -> str:
        """Get value from FlexSim tree node.
    
        Args:
            node_path: Path to node (e.g., "Model/Queue1/stats/input")
        """
        try:
            controller = await get_controller()
            script = f'getvalue(node("{params.node_path}"))'
            result = controller.evaluate(script)
    
            return f"{params.node_path} = {result}"
        except Exception as e:
            return format_error(e)
  • Schema definition for NodeAccessInput which defines the input parameters for flexsim_get_node_value tool. Uses Pydantic BaseModel for validation with a required node_path field.
    class NodeAccessInput(BaseModel):
        """Input for node operations."""
        node_path: str = Field(..., min_length=1)
        value: Any | None = Field(default=None)
  • Helper function that formats exceptions into user-friendly error messages. Used by flexsim_get_node_value to handle errors gracefully.
    def format_error(e: Exception) -> str:
        """Format exception as user-friendly error message."""
        msg = str(e)
        if "not found" in msg.lower():
            return f"Not found: {msg}"
        elif "syntax" in msg.lower():
            return f"FlexScript syntax error: {msg}"
        elif "license" in msg.lower():
            return f"License error: {msg}"
        elif "permission" in msg.lower():
            return f"Permission denied: {msg}"
        return f"Error: {msg}"
  • Helper function that gets or creates the FlexSim controller instance. Used by flexsim_get_node_value to obtain the controller for executing FlexScript commands.
    async def get_controller():
        """Get or create the FlexSim controller instance."""
        global _controller
    
        async with _controller_lock:
            if _controller is None:
                _controller = await launch_flexsim()
            return _controller
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Get' operation which implies read-only behavior, but doesn't specify whether this requires specific permissions, what happens if the node doesn't exist, whether there are rate limits, or what format the returned value will have. The description provides minimal behavioral context beyond the basic operation type.

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

Conciseness4/5

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

The description is appropriately brief and front-loaded with the core purpose. The two-sentence structure efficiently communicates the main function and provides a parameter example. However, the second sentence could be more structured as a proper parameter documentation section rather than an inline example.

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?

Given the tool has an output schema (which presumably documents return values) and only one required parameter, the description is reasonably complete for a simple read operation. However, as a mutation-free tool with no annotations, it should ideally provide more context about error conditions, permissions, and relationship to sibling tools. The presence of an output schema reduces but doesn't eliminate the need for behavioral context.

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

Parameters3/5

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

The description provides a single example for the node_path parameter ('Model/Queue1/stats/input'), which adds meaningful context beyond the schema's minimal documentation (0% coverage). However, it doesn't explain the path syntax rules, what constitutes a valid path, or how to navigate the FlexSim tree structure. The schema shows a 'value' parameter with null default, but the description doesn't mention this parameter at all.

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

Purpose4/5

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

The description clearly states the action ('Get value') and target resource ('from FlexSim tree node'), making the purpose immediately understandable. It distinguishes from siblings like 'flexsim_set_node_value' by specifying it's a read operation rather than a write operation. However, it doesn't explicitly contrast with other read operations like 'flexsim_get_statistics' or 'flexsim_get_time'.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention what types of values can be retrieved, when this tool is appropriate compared to other get operations (like flexsim_get_statistics or flexsim_get_time), or any prerequisites for using it. The only contextual clue is the sibling tool name 'flexsim_set_node_value' which implies this is the read counterpart.

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/SethGame/mcp_flexsim'

If you have feedback or need assistance with the MCP directory API, please join our Discord server