Skip to main content
Glama

run_systems_model

Execute systems model simulations with specified parameters to generate JSON output containing results as a list of dictionaries. Define model specifications and set rounds for iterative analysis.

Instructions

Run a systems model and return output of list of dictionaries in JSON.

Args: spec: The systems model specification rounds: Number of rounds to run (default: 100)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roundsNo
specYes

Implementation Reference

  • main.py:20-39 (handler)
    The main handler function for the 'run_systems_model' tool. It parses the provided spec using systems.parse, runs the model for the specified number of rounds, and returns the results as a formatted JSON string. Includes error handling.
    async def run_systems_model(spec: str, rounds: int = 100) -> str: """Run a systems model and return output of list of dictionaries in JSON. Args: spec: The systems model specification rounds: Number of rounds to run (default: 100) """ try: # Import here to avoid import errors if module is missing from systems.parse import parse debug_print(f"Running systems model for {rounds} rounds") # Parse the model and run it model = parse(spec) results = model.run(rounds=rounds) return json.dumps(results, indent=2, default=str) except Exception as e: debug_print(f"Error running systems model: {e}") return f"<div class='error'>Error running systems model: {str(e)}</div>"
  • main.py:19-19 (registration)
    Registers the run_systems_model function as an MCP tool using the FastMCP decorator.
    @mcp.tool()
  • main.py:20-26 (schema)
    Type hints and docstring defining the input schema (spec: str, rounds: int=100) and output (str: JSON). Describes the tool's purpose and parameters.
    async def run_systems_model(spec: str, rounds: int = 100) -> str: """Run a systems model and return output of list of dictionaries in JSON. Args: spec: The systems model specification rounds: Number of rounds to run (default: 100) """

Other Tools

Related 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/lethain/systems-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server