tls_reload
Reload TLS domains in OpenSIPS to apply updated certificate configurations without server restart.
Instructions
Reload TLS domains in OpenSIPS via MI command.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "tls_reload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The MCP tool handler function for 'tls_reload'. It executes the tls_reload MI command on OpenSIPS via the MI client, returning success/failure. Decorated with @mcp.tool(), @audited('tls_reload'), and @require_permission('mi.write').
@mcp.tool() @audited("tls_reload") @require_permission("mi.write") async def tls_reload(ctx: Context) -> dict[str, Any]: """Reload TLS domains in OpenSIPS via MI command.""" app = ctx.request_context.lifespan_context try: result = await app.mi_client.execute("tls_reload") return {"reloaded": True, "result": result} except Exception as exc: logger.warning("tls_reload failed: %s", exc) return {"reloaded": False, "error": str(exc)} - The docstring describes the tool's purpose ('Reload TLS domains in OpenSIPS via MI command'). The function accepts a Context (no additional parameters) and returns a dict with 'reloaded' and 'result' or 'error' keys.
"""Reload TLS domains in OpenSIPS via MI command.""" app = ctx.request_context.lifespan_context try: result = await app.mi_client.execute("tls_reload") return {"reloaded": True, "result": result} except Exception as exc: logger.warning("tls_reload failed: %s", exc) return {"reloaded": False, "error": str(exc)} - src/opensips_mcp/tools/tls_tools.py:445-456 (registration)The tool is registered as an MCP tool via the @mcp.tool() decorator on the async function tls_reload. The module is imported in server.py line 206 to activate the registration.
@mcp.tool() @audited("tls_reload") @require_permission("mi.write") async def tls_reload(ctx: Context) -> dict[str, Any]: """Reload TLS domains in OpenSIPS via MI command.""" app = ctx.request_context.lifespan_context try: result = await app.mi_client.execute("tls_reload") return {"reloaded": True, "result": result} except Exception as exc: logger.warning("tls_reload failed: %s", exc) return {"reloaded": False, "error": str(exc)} - src/opensips_mcp/tools/reload_tools.py:48-49 (registration)The tool name 'tls_reload' is also referenced in the reload_data_tables tool's target list, mapped to module 'tls_mgm', allowing batch reload of TLS along with other modules.
("tls_reload", "tls_mgm"), ] - MI command registration for tls_reload, describing it as 'Reload TLS domains from database', associated with module 'tls_mgm', permission 'mi.write', category 'tls_mgm'.
_r("tls_reload", "tls_mgm", "Reload TLS domains from database", permission="mi.write", category="tls_mgm") _r("tls_list", "tls_mgm", "List configured TLS domains", category="tls_mgm") _r("tls_info", "tls_mgm", "Show TLS domain configuration details", category="tls_mgm") _r("tls_trace", "tls_mgm", "Enable or disable TLS tracing", ["mode"], "mi.write", "tls_mgm")