Skip to main content
Glama
SethGame

FlexSim MCP Server

by SethGame

flexsim_stop

Stop the running FlexSim simulation to pause model execution, halt data collection, and prepare for analysis or parameter adjustments in manufacturing and warehouse digital twin environments.

Instructions

Stop the running simulation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The flexsim_stop tool handler decorated with @mcp.tool() that stops the running FlexSim simulation and returns the stop time. It uses get_controller() to access the FlexSim controller, calls controller.stop(), and formats the result with format_time().
    @mcp.tool()
    async def flexsim_stop() -> str:
        """Stop the running simulation."""
        try:
            controller = await get_controller()
            controller.stop()
            time = controller.time()
            return f"✓ Stopped at {format_time(time)}"
        except Exception as e:
            return format_error(e)
  • Helper function get_controller() used by flexsim_stop to get or create the FlexSim controller instance with thread-safe locking.
    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
  • Helper function format_time() used by flexsim_stop to format simulation time as human-readable string (seconds, minutes, or 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"
  • Helper function format_error() used by flexsim_stop to format exceptions as user-friendly error messages with special handling for common error types.
    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}"
Behavior2/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 states the action ('Stop') but does not explain what 'Stop' entails—whether it halts execution immediately, saves state, requires specific permissions, or has side effects. This leaves significant gaps in understanding the tool's behavior beyond the basic action.

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, direct sentence with no wasted words, clearly front-loading the core action. It is appropriately sized for a simple tool with no parameters, making it highly efficient and easy to understand.

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's simplicity (0 parameters, no annotations, but has an output schema), the description is minimally complete. It states what the tool does but lacks details on behavioral aspects like what 'Stop' means operationally or error conditions. The output schema may cover return values, but the description could benefit from more context on the stopping process.

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 tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description does not add parameter semantics, which is appropriate here. A baseline of 4 is applied as it adequately handles the lack of parameters without introducing confusion.

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 ('Stop') and the target resource ('the running simulation'), using a precise verb+resource combination. It effectively distinguishes this tool from siblings like 'flexsim_reset' or 'flexsim_pause' (if existed) by focusing on termination rather than resetting or pausing.

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 implies usage context by specifying 'the running simulation,' suggesting it should be used when a simulation is actively executing. However, it does not explicitly state when not to use it (e.g., if no simulation is running) or name alternatives like 'flexsim_reset' for different stopping scenarios, keeping it from a perfect score.

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