tls_delete
Delete an existing TLS domain configuration from OpenSIPS by specifying the domain name.
Instructions
Remove a TLS domain configuration.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Tool handler function for tls_delete — removes a TLS domain configuration by delegating to CRUD layer.
@mcp.tool() @audited("tls_delete") @require_permission("db.write") async def tls_delete(ctx: Context, domain: str) -> dict[str, Any]: """Remove a TLS domain configuration.""" from opensips_mcp.db.crud import tls as crud app = ctx.request_context.lifespan_context async with app.db_session_factory() as session: deleted = await crud.delete_tls_domain(session, domain) if not deleted: return {"error": "TLS domain not found", "deleted": False} return {"domain": domain, "deleted": True} - Input schema is implicit via the function signature — takes a single 'domain: str' parameter. No explicit Pydantic schema is defined.
@mcp.tool() @audited("tls_delete") @require_permission("db.write") async def tls_delete(ctx: Context, domain: str) -> dict[str, Any]: """Remove a TLS domain configuration.""" from opensips_mcp.db.crud import tls as crud app = ctx.request_context.lifespan_context async with app.db_session_factory() as session: deleted = await crud.delete_tls_domain(session, domain) if not deleted: return {"error": "TLS domain not found", "deleted": False} return {"domain": domain, "deleted": True} - src/opensips_mcp/tools/tls_tools.py:430-430 (registration)Registered as an MCP tool via the @mcp.tool() decorator on the async function.
@mcp.tool() - CRUD helper that executes the SQL DELETE statement against the tls_mgm table using SQLAlchemy.
async def delete_tls_domain(session: AsyncSession, domain: str) -> bool: stmt = delete(TLSDomain).where(TLSDomain.domain == domain) result = await session.execute(stmt) await session.commit() return result.rowcount > 0 - SQLAlchemy model for the tls_mgm table that the delete operation targets.
class TLSDomain(Base): __tablename__ = "tls_mgm" id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True) domain: Mapped[str] = mapped_column(String(64), nullable=False) match_ip_address: Mapped[str] = mapped_column(String(255), default="") match_sip_domain: Mapped[str] = mapped_column(String(255), default="") type: Mapped[int] = mapped_column(Integer, default=1) # 1=client, 2=server method: Mapped[str] = mapped_column(String(16), default="TLSv1_2") verify_cert: Mapped[int] = mapped_column(Integer, default=1) require_cert: Mapped[int] = mapped_column(Integer, default=1) certificate: Mapped[str | None] = mapped_column(Text, nullable=True) private_key: Mapped[str | None] = mapped_column(Text, nullable=True) ca_list: Mapped[str | None] = mapped_column(Text, nullable=True) ca_dir: Mapped[str] = mapped_column(String(255), default="") cipher_list: Mapped[str] = mapped_column(String(255), default="") dh_params: Mapped[str | None] = mapped_column(Text, nullable=True) ec_curve: Mapped[str] = mapped_column(String(64), default="")