Skip to main content
Glama
SethGame

FlexSim MCP Server

by SethGame

flexsim_save_model

Save the current FlexSim simulation model to a specified file path, preserving all configurations and data for future use or analysis.

Instructions

Save the current model.

Args:
    save_path: Path to save (optional, uses current if not provided)

Example:
    save_path="C:/Models/warehouse_v2.fsm"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function flexsim_save_model that executes the save model logic. It accepts an optional save_path parameter, uses the FlexSim controller to evaluate the savemodel() FlexScript command, and returns a success message indicating where the model was saved.
    @mcp.tool()
    async def flexsim_save_model(params: SaveModelInput) -> str:
        """Save the current model.
    
        Args:
            save_path: Path to save (optional, uses current if not provided)
    
        Example:
            save_path="C:/Models/warehouse_v2.fsm"
        """
        try:
            controller = await get_controller()
    
            if params.save_path:
                script = f'savemodel("{params.save_path}")'
                location = params.save_path
            else:
                script = "savemodel()"
                location = "current location"
    
            controller.evaluate(script)
            return f"✓ Model saved to {location}"
        except Exception as e:
            return format_error(e)
  • The SaveModelInput schema class that defines the input validation for the flexsim_save_model tool. It uses Pydantic BaseModel with an optional save_path string field that defaults to None.
    class SaveModelInput(BaseModel):
        """Input for saving model."""
        save_path: str | None = Field(default=None)
  • The @mcp.tool() decorator that registers the flexsim_save_model function as an MCP tool, making it available to clients through the Model Context Protocol server.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a write operation ('Save') but doesn't disclose critical traits: whether it overwrites existing files, requires specific permissions, handles errors, or affects model state. The example hints at file path usage but lacks details on format constraints or side effects.

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 front-loaded with the core purpose, followed by structured Args and Example sections. Every sentence earns its place: the first states the action, the second clarifies parameter behavior, and the third provides concrete usage. No redundant or verbose elements are present.

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 moderate complexity (save operation with one parameter) and the presence of an output schema (which likely handles return values), the description is minimally adequate. However, it lacks completeness for a mutation tool: no annotations, no mention of error handling or side effects, and insufficient guidance on usage context. It meets basic needs but has clear gaps.

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?

Schema description coverage is 0%, but the description compensates by explaining the single parameter 'save_path' as optional and defaulting to current path. It adds meaning beyond the schema's basic type/optionality, though it doesn't detail path format (e.g., file extension requirements). With only one parameter, the baseline is 4, but limited semantic depth reduces this to 3.

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 ('Save') and resource ('the current model'), making the purpose immediately understandable. It distinguishes this from siblings like 'flexsim_compile' or 'flexsim_export_results' by focusing on model persistence rather than compilation or data export. However, it doesn't explicitly differentiate from 'flexsim_open_model' in terms of file operations.

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., requires an open model), exclusions, or relationships with siblings like 'flexsim_new_model' (for creating) or 'flexsim_open_model' (for loading). The example shows usage but lacks contextual decision-making advice.

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