Skip to main content
Glama
OpenSIPS

OpenSIPS MCP Server

Official
by OpenSIPS

sipp_run_scenario

Execute a SIPp XML scenario against a target SIP server to test call flows and performance. Specify the scenario file, target host:port, and optional CLI flags.

Instructions

Run a SIPp XML scenario file against a target SIP server.

Parameters

scenario_file: Path to the .xml SIPp scenario file. target: Target host:port (e.g. 192.168.1.1:5060). options: JSON string of extra CLI flags, e.g. {"-m": "10", "-r": "5"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scenario_fileYes
targetYes
optionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'sipp_run_scenario'. Decorated with @mcp.tool(), @audited('sipp_run_scenario'), and @require_permission('process.manage'). Parses optional JSON options and delegates to SIPpRunner.run_scenario().
    @mcp.tool()
    @audited("sipp_run_scenario")
    @require_permission("process.manage")
    async def sipp_run_scenario(
        ctx: Context,
        scenario_file: str,
        target: str,
        options: str | None = None,
    ) -> dict[str, Any]:
        """Run a SIPp XML scenario file against a target SIP server.
    
        Parameters
        ----------
        scenario_file:
            Path to the .xml SIPp scenario file.
        target:
            Target host:port (e.g. ``192.168.1.1:5060``).
        options:
            JSON string of extra CLI flags, e.g. ``{"-m": "10", "-r": "5"}``.
        """
        opts: dict[str, str] | None = None
        if options:
            try:
                opts = json.loads(options)
            except json.JSONDecodeError:
                return {"error": f"Invalid options JSON: {options}"}
    
        return await SIPpRunner.run_scenario(scenario_file, target, options=opts)
  • SIPpRunner.run_scenario() static method — the actual implementation that validates the scenario file exists, builds the 'sipp' CLI command (with -sf, -trace_err, -trace_stat), launches it as a subprocess, and returns stdout/stderr/return_code.
    @staticmethod
    async def run_scenario(
        scenario_file: str,
        target: str,
        *,
        options: dict[str, str] | None = None,
        timeout: int = 120,
    ) -> dict[str, Any]:
        """Run a SIPp XML scenario against a target.
    
        Parameters
        ----------
        scenario_file:
            Path to the ``.xml`` SIPp scenario file.
        target:
            Target host (``host:port`` format).
        options:
            Extra CLI flags as key/value pairs (e.g. ``{"-m": "10"}``).
        timeout:
            Max seconds to wait for the process.
        """
        if not Path(scenario_file).is_file():
            return {"error": f"Scenario file not found: {scenario_file}"}
    
        cmd: list[str] = [
            "sipp",
            target,
            "-sf", scenario_file,
            "-trace_err",
            "-trace_stat",
        ]
    
        if options:
            for flag, value in options.items():
                cmd.extend([flag, value])
    
        try:
            proc = await asyncio.create_subprocess_exec(
                *cmd,
                stdout=asyncio.subprocess.PIPE,
                stderr=asyncio.subprocess.PIPE,
            )
            stdout, stderr = await asyncio.wait_for(proc.communicate(), timeout=timeout)
            return {
                "return_code": proc.returncode,
                "stdout": stdout.decode(errors="replace")[-4096:],
                "stderr": stderr.decode(errors="replace")[-2048:],
                "scenario": scenario_file,
                "target": target,
            }
        except asyncio.TimeoutError:
            return {"error": "SIPp process timed out", "timeout": timeout}
        except FileNotFoundError:
            return {"error": "sipp binary not found — install SIPp first"}
  • Resource descriptor for 'sipp_run_scenario' documenting parameters (scenario_file, target, options), required permission (process.manage), and an example invocation.
    "sipp_run_scenario": {
        "description": "Run a SIPp XML scenario against a target",
        "parameters": "scenario_file, target, options (JSON string)",
        "permission": "process.manage",
        "example": 'sipp_run_scenario(scenario_file="/etc/sipp/uac.xml", target="10.0.0.1:5060")',
    },
  • Listing of 'sipp_run_scenario' under the 'sipp' tool group in the ecosystem_health overview.
    "sipp": ["sipp_run_scenario", "sipp_load_test", "sipp_list_scenarios"],
Behavior2/5

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

No annotations provided, so description must disclose behavioral traits. It only states the action and parameters, not side effects, permissions, or rate limits. Lacks detail for a run 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?

Description is a single sentence followed by a concise parameter list. Every sentence is purposeful, no fluff, and front-loaded with the main action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (not examined), the description adequately covers execution. Could mention prerequisites like file validity, but not essential.

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?

Schema coverage is 0%, but the description fully explains each parameter (scenario_file, target, options) with examples, adding significant value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Run a SIPp XML scenario file against a target SIP server' clearly states the action (run), resource (SIPp XML scenario), and target, distinguishing it from siblings like 'sipp_list_scenarios' and 'sip_generate_sipp_scenario'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives (e.g., 'sipp_load_test'). Only implied usage from the tool's name and description, with no exclusions or context.

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/OpenSIPS/opensips-mcp-server'

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