Skip to main content
Glama
lethain
by lethain

run_systems_model

Execute systems models to simulate complex scenarios and generate structured JSON output for analysis and decision-making.

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
specYes
roundsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:19-19 (registration)
    The @mcp.tool() decorator registers the 'run_systems_model' function as an MCP tool.
    @mcp.tool()
  • main.py:20-39 (handler)
    The handler function that implements the tool logic: imports and uses systems.parse.parse to parse the spec, runs the model for the given rounds, returns JSON results or an HTML error message.
    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:20-26 (schema)
    Type hints and docstring define the input schema (spec: str, rounds: int=100) and output (str JSON or error HTML).
    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)
        """
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 tool runs a model and returns JSON output, but doesn't describe what 'running a systems model' entails (e.g., computational requirements, execution time, side effects, error conditions, or authentication needs). For a tool that presumably performs computation, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences that directly address purpose and parameters. The structure is front-loaded with the core functionality first, followed by parameter details. No wasted words, though it could be slightly more polished in formatting.

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 that there's an output schema (which handles return value documentation) but no annotations and incomplete parameter semantics, the description is minimally adequate. It covers the basic purpose and parameters but lacks important behavioral context for a computational tool. The presence of an output schema reduces the need to describe return values, but other gaps remain.

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?

The description adds some semantic context beyond the schema: it explains that 'spec' is 'The systems model specification' and 'rounds' is 'Number of rounds to run (default: 100)'. However, with 0% schema description coverage, the description doesn't fully compensate - it doesn't explain what format the 'spec' should be in (e.g., JSON, YAML, specific syntax) or what 'rounds' means in the context of systems modeling.

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 tool's purpose: 'Run a systems model and return output of list of dictionaries in JSON.' This specifies the verb ('Run'), resource ('a systems model'), and output format. However, it doesn't explicitly differentiate from the sibling tool 'load_systems_documentation', which appears to be a documentation loading function rather than a model execution tool.

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 the sibling tool 'load_systems_documentation' or any other context for selection. The only usage hint is the default value for 'rounds', but this doesn't help with tool selection decisions.

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

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