Skip to main content
Glama
OpenSIPS

OpenSIPS MCP Server

Official
by OpenSIPS

dialplan_translate

Test a dialplan translation by providing a dialplan ID and input string to retrieve the translated output and matching rule metadata, without initiating a call.

Instructions

Test a dialplan translation without dispatching a call.

Parameters

dpid: Dialplan table id. input: Input string to translate (e.g. +14155551212).

Returns

The translated output string and matching rule metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dpidYes
inputYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async function dialplan_translate that executes the tool logic. It uses the MI client to call 'dp_translate' with dpid and input parameters.
    async def dialplan_translate(ctx: Context, dpid: int, input: str) -> dict[str, Any]:
        """Test a dialplan translation without dispatching a call.
    
        Parameters
        ----------
        dpid:
            Dialplan table id.
        input:
            Input string to translate (e.g. ``+14155551212``).
    
        Returns
        -------
        The translated output string and matching rule metadata.
        """
        app = ctx.request_context.lifespan_context
        return await app.mi_client.execute(
            "dp_translate", {"dpid": str(dpid), "input": input}
        )
  • The @mcp.tool() decorator registers dialplan_translate as an MCP tool. The module is imported in server.py line 173 to ensure registration.
    @mcp.tool()
    @require_permission("mi.read")
    async def dialplan_translate(ctx: Context, dpid: int, input: str) -> dict[str, Any]:
  • Type hints serve as the input schema: ctx (Context), dpid (int), input (str). Returns dict[str, Any].
    async def dialplan_translate(ctx: Context, dpid: int, input: str) -> dict[str, Any]:
  • Imports the 'mcp' instance (the FastMCP server) used for tool registration, and 'require_permission' for RBAC enforcement.
    from opensips_mcp.security.audit import audited
    from opensips_mcp.security.rbac import require_permission
    from opensips_mcp.server import mcp
  • The dialplan_tools module is imported in server.py, which triggers the @mcp.tool() decorators and registers all dialplan tools including dialplan_translate.
    from opensips_mcp.tools import dialplan_tools as _dialplan_tools  # noqa: E402, F401
Behavior4/5

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

No annotations are provided, so the description carries the burden. It explicitly states the tool does not dispatch a call, implying non-destructive behavior. It also mentions the return of translated output and metadata, giving sufficient 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.

Conciseness5/5

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

The description is very concise, with a clear one-line purpose, followed by a structured list of parameters and returns. Every sentence adds value without redundancy.

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

Completeness5/5

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

For a simple two-parameter tool with an output schema, the description covers purpose, parameters, and returns completely. No additional context is needed.

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 description adds a Parameters section with explanations for 'dpid' (Dialplan table id) and 'input' (example format), which goes beyond the schema's title and type. This provides useful context, especially with 0% schema description coverage.

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 that the tool tests a dialplan translation without dispatching a call. It uses the specific verb 'test' and resource 'dialplan translation', distinguishing it from sibling tools like dialplan_add_rule or dialplan_list_rules.

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

Usage Guidelines4/5

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

The description implies usage for testing before actual dispatch ('without dispatching a call'). However, it does not explicitly state when to use this tool versus alternatives like actually dispatching or checking rules, so a slight gap exists.

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