Skip to main content
Glama
OpenSIPS

OpenSIPS MCP Server

Official
by OpenSIPS

b2b_trigger_scenario

Trigger a B2B user agent scenario by its ID, using optional custom SIP headers and semicolon-delimited parameters for per-scenario configuration.

Instructions

Trigger a B2B scenario by id (defined in b2b_logic XML scenarios).

Parameters

scenario_id: Scenario id from the b2b_logic configuration. custom_hdrs: Optional custom SIP headers for the scenario invocation. params: Optional semicolon-delimited parameters (per-scenario).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scenario_idYes
custom_hdrsNo
paramsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the b2b_trigger_scenario MCP tool. It is decorated with @mcp.tool(), @audited("b2b_trigger_scenario"), and @require_permission("mi.write"). Accepts scenario_id (required), custom_hdrs (optional), and params (optional), then executes the MI command via app.mi_client.execute.
    @mcp.tool()
    @audited("b2b_trigger_scenario")
    @require_permission("mi.write")
    async def b2b_trigger_scenario(
        ctx: Context,
        scenario_id: str,
        custom_hdrs: str = "",
        params: str = "",
    ) -> dict[str, Any]:
        """Trigger a B2B scenario by id (defined in b2b_logic XML scenarios).
    
        Parameters
        ----------
        scenario_id:
            Scenario id from the b2b_logic configuration.
        custom_hdrs:
            Optional custom SIP headers for the scenario invocation.
        params:
            Optional semicolon-delimited parameters (per-scenario).
        """
        app = ctx.request_context.lifespan_context
        return await app.mi_client.execute(
            "b2b_trigger_scenario",
            {"id": scenario_id, "custom_hdrs": custom_hdrs, "params": params},
        )
  • Registration of the MI command metadata for b2b_trigger_scenario. Defines the MI module ('b2b_logic'), description, expected parameters (['id', 'custom_hdrs', 'params']), and permission level ('mi.write').
    _r("b2b_trigger_scenario", "b2b_logic", "Trigger a B2B scenario by id", ["id", "custom_hdrs", "params"], "mi.write", "b2b_logic")
  • The @mcp.tool() decorator registers this function as an MCP tool named 'b2b_trigger_scenario' (inferred from function name). This is how the tool becomes available in the MCP tool registry.
    @mcp.tool()
Behavior2/5

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

No annotations exist, so the description carries the full burden. It does not disclose whether the tool is destructive, read-only, or requires specific permissions. The behavioral impact of triggering a scenario (e.g., starting a call, modifying state) is unexplained.

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 extremely concise—one sentence for the purpose followed by a clear, structured parameter list. No wasted words.

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?

With 3 parameters (1 required, 2 with defaults) and an output schema presumably indicating success/failure, the description covers the core purpose but omits expected behavior like prerequisites (scenario must exist), error handling, or return value 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?

Despite the schema having no descriptions (0% coverage), the description adds meaningful context: scenario_id is from b2b_logic XML, custom_hdrs are optional SIP headers, and params are semicolon-delimited per-scenario. This compensates for the schema gap.

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 clearly states it triggers a B2B scenario by ID, referencing XML scenarios. The verb 'trigger' and resource 'B2B scenario' are specific, and it distinguishes from siblings like b2b_bridge or b2b_terminate by its focus on scenario invocation.

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?

No guidance is provided on when to use this tool versus alternatives such as sipp_run_scenario or b2b_bridge. There are no explicit conditions or exclusions mentioned.

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