Skip to main content
Glama
OpenSIPS

OpenSIPS MCP Server

Official
by OpenSIPS

b2b_terminate

Terminate any active B2B session using its unique entity key obtained from listing sessions.

Instructions

Terminate a B2B session by its entity key.

Parameters

key: The B2B session key as reported by b2b_list_sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function that executes the b2b_terminate tool logic. Decorated with @mcp.tool(), @audited('b2b_terminate'), and @require_permission('mi.write'). Takes a 'key' parameter identifying the B2B session to terminate and executes the 'b2b_terminate' MI command via the MI client.
    @mcp.tool()
    @audited("b2b_terminate")
    @require_permission("mi.write")
    async def b2b_terminate(ctx: Context, key: str) -> dict[str, Any]:
        """Terminate a B2B session by its entity key.
    
        Parameters
        ----------
        key:
            The B2B session key as reported by ``b2b_list_sessions``.
        """
        app = ctx.request_context.lifespan_context
        return await app.mi_client.execute("b2b_terminate", {"key": key})
  • Registration of b2b_terminate as an MCP tool via the @mcp.tool() decorator on the handler function.
    @mcp.tool()
    @audited("b2b_terminate")
  • Registers the 'b2b_terminate' MI command in the MI_COMMANDS registry under the 'b2b_logic' module/category, requiring 'mi.write' permission, with a 'key' parameter description.
    _r("b2b_terminate", "b2b_logic", "Terminate a B2B session", ["key"], "mi.write", "b2b_logic")
Behavior2/5

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

No annotations are provided, so the description must carry the burden. It discloses the action (terminate) but lacks details on side effects, authority needed, error handling, or idempotency. Critical behavioral traits for a termination action are missing.

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: a one-line purpose statement and a one-line parameter description. No redundant information, front-loaded, efficient.

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 the tool is simple with one parameter and an output schema exists, the description is adequate but not fully complete. It lacks information about behavioral expectations (e.g., what happens on success/failure, permissions needed), which is important for a termination action.

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?

The schema has no description for the parameter (0% coverage). The description adds value by explaining that the key is 'as reported by b2b_list_sessions', providing a clear source for valid values. This goes beyond the raw 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 clearly states the verb 'terminate' and the resource 'B2B session', and distinguishes from sibling tools like b2b_bridge and b2b_trigger_scenario which have different purposes.

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 explicit guidance on when to use this tool versus alternatives, nor any exclusions. It only notes the prerequisite source for the key (b2b_list_sessions), but no comparison to other termination methods or conditions.

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