Skip to main content
Glama
SethGame

FlexSim MCP Server

by SethGame

flexsim_export_results

Export simulation results to CSV, Excel, or JSON files for analysis and reporting.

Instructions

Export simulation results to file.

Args:
    export_path: Path to save results
    format: Export format (csv, xlsx, json)

Example:
    export_path="C:/Results/output.csv"
    format="csv"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function that exports simulation results to CSV, XLSX, or JSON format. It takes an ExportResultsInput parameter and uses FlexSim's exporttable(), exportexcel(), or exportjson() FlexScript commands depending on the requested format.
    async def flexsim_export_results(params: ExportResultsInput) -> str:
        """Export simulation results to file.
    
        Args:
            export_path: Path to save results
            format: Export format (csv, xlsx, json)
    
        Example:
            export_path="C:/Results/output.csv"
            format="csv"
        """
        try:
            controller = await get_controller()
    
            # Build export script based on format
            fmt = params.format.lower()
            if fmt == "csv":
                script = f'exporttable("{params.export_path}")'
            elif fmt == "xlsx":
                script = f'exportexcel("{params.export_path}")'
            else:
                script = f'exportjson("{params.export_path}")'
    
            controller.evaluate(script)
            return f"✓ Results exported to {params.export_path}"
        except Exception as e:
            return format_error(e)
  • Pydantic BaseModel defining the input validation schema for the flexsim_export_results tool. Requires an export_path string and accepts an optional format parameter (defaults to 'csv').
    class ExportResultsInput(BaseModel):
        """Input for exporting results."""
        export_path: str = Field(...)
        format: str = Field(default="csv")
  • The @mcp.tool() decorator that registers the flexsim_export_results function with the FastMCP server, making it available as an MCP tool.
    @mcp.tool()
    async def flexsim_export_results(params: ExportResultsInput) -> str:
  • FastMCP server initialization that creates the 'flexsim_mcp' server instance which all tools (including flexsim_export_results) are registered to.
    mcp = FastMCP("flexsim_mcp", lifespan=lifespan)
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 (export) but lacks critical details: whether this overwrites existing files, requires specific permissions, has rate limits, or what happens on failure (e.g., invalid path). The example helps but doesn't cover behavioral traits beyond the basic operation, leaving significant gaps for a mutation tool.

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 efficiently structured: a clear purpose statement, bullet-pointed args with brief explanations, and a concrete example. Every sentence earns its place by providing essential information without redundancy. It's front-loaded with the main action and remains appropriately sized for the tool's complexity.

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 handles return values) and low complexity, the description covers the basics adequately. However, as a mutation tool with no annotations, it should include more behavioral context (e.g., side effects, error handling). The parameter explanations help, but overall completeness is moderate due to missing usage and transparency details.

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 description adds substantial value beyond the input schema, which has 0% description coverage. It explains both parameters: export_path as 'Path to save results' and format as 'Export format (csv, xlsx, json)' with an example. This clarifies semantics that the schema alone doesn't provide, though it doesn't detail format constraints (e.g., case sensitivity) or path requirements, keeping it from a perfect score.

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 verb 'export' and resource 'simulation results to file', making the purpose immediately understandable. It distinguishes from siblings like flexsim_get_statistics (which retrieves but doesn't export) and flexsim_save_model (which saves the model, not results). However, it doesn't explicitly contrast with all siblings, keeping it at 4 rather than 5.

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 simulation results first from flexsim_run or flexsim_get_statistics), nor does it specify scenarios where export is appropriate versus using other tools for data access. This leaves the agent with minimal context for decision-making.

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