Skip to main content
Glama
SethGame

FlexSim MCP Server

by SethGame

flexsim_new_model

Create a new blank simulation model to build manufacturing or warehouse digital twins for analysis and parameter studies.

Instructions

Create a new blank model.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler implementation for flexsim_new_model tool. Gets the FlexSim controller, executes newmodel() FlexScript command, and returns success/error message.
    @mcp.tool()
    async def flexsim_new_model() -> str:
        """Create a new blank model."""
        try:
            controller = await get_controller()
            controller.evaluate("newmodel()")
            return "✓ New blank model created"
        except Exception as e:
            return format_error(e)
  • Helper function get_controller() that retrieves or creates the FlexSim controller instance, used by flexsim_new_model to access the simulation.
    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_error() that formats exceptions into user-friendly error messages, used by flexsim_new_model for error handling.
    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}"
  • FastMCP server initialization at line 216 where the MCP server instance 'mcp' is created, which is used to register the flexsim_new_model tool via the @mcp.tool() decorator.
    mcp = FastMCP("flexsim_mcp", lifespan=lifespan)
  • Documentation entry for flexsim_new_model tool in the Model & Script section, describing it as 'Create blank model'.
    | `flexsim_new_model` | Create blank model |
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 'Create a new blank model,' which implies a write/mutation operation, but doesn't disclose any behavioral traits such as whether this requires specific permissions, if it overwrites existing models, what the output looks like (though an output schema exists), or any side effects. For a mutation tool with zero annotation coverage, this is a significant gap.

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 ('Create') and efficiently conveys the purpose. Every word 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's complexity (simple creation with no parameters) and the presence of an output schema (which handles return values), the description is minimally complete. However, it lacks context about the model's state (e.g., is it in memory or saved to disk?) and doesn't integrate with sibling tools. For a mutation tool with no annotations, it should do more to explain behavior and usage.

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 the schema description coverage is 100% (as there are no parameters to describe). The description doesn't need to add parameter semantics beyond what the schema provides. A baseline of 4 is appropriate for zero-parameter tools, as there's nothing to compensate for.

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 ('Create') and the resource ('a new blank model'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'flexsim_open_model' (which opens existing models) or 'flexsim_save_model' (which saves models), though the 'blank' qualifier implies it's not opening an existing file. A 5 would require explicit sibling differentiation.

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. For example, it doesn't mention whether this should be used before other operations like 'flexsim_run' or 'flexsim_set_node_value', or if it's a prerequisite for certain workflows. There's no context about when not to use it or what alternatives exist among the siblings.

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