Skip to main content
Glama
OpenSIPS

OpenSIPS MCP Server

Official
by OpenSIPS

tls_add

Add a new TLS domain configuration to secure SIP traffic by specifying domain, certificate, private key, CA list, and other TLS settings for OpenSIPS.

Instructions

Add a new TLS domain configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes
typeNo
methodNoTLSv1_2
verify_certNo
require_certNo
certificateNo
private_keyNo
ca_listNo
ca_dirNo
cipher_listNo
dh_paramsNo
ec_curveNo
match_ip_addressNo
match_sip_domainNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tls_add MCP tool handler. Decorated with @mcp.tool(), @audited('tls_add'), and @require_permission('db.write'). Accepts TLS domain parameters and delegates persistence to crud.create_tls_domain().
    @mcp.tool()
    @audited("tls_add")
    @require_permission("db.write")
    async def tls_add(
        ctx: Context,
        domain: str,
        type: int = 1,
        method: str = "TLSv1_2",
        verify_cert: int = 1,
        require_cert: int = 1,
        certificate: str | None = None,
        private_key: str | None = None,
        ca_list: str | None = None,
        ca_dir: str = "",
        cipher_list: str = "",
        dh_params: str | None = None,
        ec_curve: str = "",
        match_ip_address: str = "",
        match_sip_domain: str = "",
    ) -> dict[str, Any]:
        """Add a new 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:
            result = await crud.create_tls_domain(
                session,
                domain=domain,
                type=type,
                method=method,
                verify_cert=verify_cert,
                require_cert=require_cert,
                certificate=certificate,
                private_key=private_key,
                ca_list=ca_list,
                ca_dir=ca_dir,
                cipher_list=cipher_list,
                dh_params=dh_params,
                ec_curve=ec_curve,
                match_ip_address=match_ip_address,
                match_sip_domain=match_sip_domain,
            )
            return {"created": True, **result}
  • The CRUD helper create_tls_domain() that creates a TLSDomain ORM object, persists it, and returns the serialized result.
    async def create_tls_domain(
        session: AsyncSession,
        domain: str,
        type: int = 1,
        method: str = "TLSv1_2",
        verify_cert: int = 1,
        require_cert: int = 1,
        certificate: str | None = None,
        private_key: str | None = None,
        ca_list: str | None = None,
        ca_dir: str = "",
        cipher_list: str = "",
        dh_params: str | None = None,
        ec_curve: str = "",
        match_ip_address: str = "",
        match_sip_domain: str = "",
    ) -> dict[str, Any]:
        t = TLSDomain(
            domain=domain,
            match_ip_address=match_ip_address,
            match_sip_domain=match_sip_domain,
            type=type,
            method=method,
            verify_cert=verify_cert,
            require_cert=require_cert,
            certificate=certificate,
            private_key=private_key,
            ca_list=ca_list,
            ca_dir=ca_dir,
            cipher_list=cipher_list,
            dh_params=dh_params,
            ec_curve=ec_curve,
        )
        session.add(t)
        await session.commit()
        await session.refresh(t)
        return _to_dict(t)
  • The _to_dict() helper that serializes a TLSDomain object into a dictionary.
    def _to_dict(t: TLSDomain) -> dict[str, Any]:
        return {
            "id": t.id,
            "domain": t.domain,
            "match_ip_address": t.match_ip_address,
            "match_sip_domain": t.match_sip_domain,
            "type": t.type,
            "method": t.method,
            "verify_cert": t.verify_cert,
            "require_cert": t.require_cert,
            "certificate": t.certificate,
            "private_key": t.private_key,
            "ca_list": t.ca_list,
            "ca_dir": t.ca_dir,
            "cipher_list": t.cipher_list,
            "dh_params": t.dh_params,
            "ec_curve": t.ec_curve,
        }
  • Registration via @mcp.tool() decorator on the tls_add function at line 345.
    @mcp.tool()
  • The TLSDomain SQLAlchemy ORM model (table 'tls_mgm') defining all TLS domain columns.
    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="")
Behavior2/5

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

With no annotations, the description must disclose behavioral traits, but it only says 'Add' without indicating permissions, reversibility, or impact. The 14 parameters are not explained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

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

Extremely concise (one sentence) but under-specified. It is not structured and provides minimal information beyond the tool name.

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

Completeness2/5

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

Given the complexity (14 parameters, no annotations, output schema present), the description fails to provide essential context for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description adds no meaning to any of the 14 parameters. The agent gets no help on how to fill in parameters.

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 action ('Add') and the resource ('new TLS domain configuration'), distinguishing it from sibling tools like tls_update or tls_delete.

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 on when to use this tool versus alternatives like tls_update or tls_list. No prerequisites or context provided.

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