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

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)

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