Skip to main content
Glama
SethGame

FlexSim MCP Server

by SethGame

flexsim_run

Start continuous simulation execution in FlexSim to analyze manufacturing and warehouse digital twins, perform parameter studies, and manipulate models in real-time.

Instructions

Start running the simulation continuously.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The flexsim_run tool handler that starts continuous simulation. Gets the controller and calls controller.run() to start the simulation, returning a success message with a hint to use flexsim_stop to pause.
    @mcp.tool()
    async def flexsim_run() -> str:
        """Start running the simulation continuously."""
        try:
            controller = await get_controller()
            controller.run()
            return "✓ Simulation running (use flexsim_stop to pause)"
        except Exception as e:
            return format_error(e)
  • Registration of flexsim_run as an MCP tool using the @mcp.tool() decorator from FastMCP framework.
    @mcp.tool()
    async def flexsim_run() -> str:
        """Start running the simulation continuously."""
        try:
            controller = await get_controller()
            controller.run()
            return "✓ Simulation running (use flexsim_stop to pause)"
        except Exception as e:
            return format_error(e)
  • format_time helper function used to format simulation time as human-readable strings (seconds, minutes, hours).
    def format_time(seconds: float) -> str:
        """Format simulation time as human-readable string."""
        if seconds < 60:
            return f"{seconds:.2f}s"
        elif seconds < 3600:
            return f"{seconds/60:.2f}m"
        else:
            return f"{seconds/3600:.2f}h"
  • format_error helper function that formats exceptions into user-friendly error messages, categorizing errors by type (not found, syntax, license, permission).
    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}"
  • get_controller helper function that manages the global FlexSim controller instance, creating it lazily on first use via launch_flexsim() with async locking for thread safety.
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool starts continuous simulation but lacks details on what 'continuously' entails (e.g., runs until stopped, may block other operations), potential side effects, or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, clear sentence with no wasted words. It's front-loaded with the core action ('Start running') and efficiently conveys the essential purpose. Every part of the sentence earns its place, making it highly concise and well-structured.

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 0 parameters, 100% schema coverage, and an output schema exists, the description's job is simplified. It adequately states what the tool does but lacks context on usage relative to siblings and behavioral details. For a tool that likely initiates a significant simulation process, more guidance on effects and alternatives would improve completeness.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is given as it avoids redundancy and correctly aligns with the schema's completeness.

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 ('Start running') and the target ('the simulation continuously'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'flexsim_run_to_time' or 'flexsim_step', which also involve running the simulation but with different conditions or modes.

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 prerequisites (e.g., needing a loaded model), exclusions, or comparisons to siblings like 'flexsim_run_to_time' (for running to a specific time) or 'flexsim_step' (for incremental execution). This leaves the agent without context for tool selection.

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