Skip to main content
Glama
OpenSIPS

OpenSIPS MCP Server

Official
by OpenSIPS

avp_delete

Delete a global AVP to remove it from the OpenSIPS configuration, helping you manage and clean up unnecessary attribute-value pairs.

Instructions

Delete a global AVP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'avp_delete'. It is registered with @mcp.tool(), decorated with @audited('avp_delete') for audit logging, and @require_permission('mi.write') for RBAC. It sends an MI command 'avp_delete' with the AVP name to the OpenSIPS server via the MI client.
    @mcp.tool()
    @audited("avp_delete")
    @require_permission("mi.write")
    async def avp_delete(ctx: Context, name: str) -> dict[str, Any]:
        """Delete a global AVP."""
        app = ctx.request_context.lifespan_context
        return await app.mi_client.execute("avp_delete", {"name": name})
  • Registration of the 'avp_delete' MI command in the command registry. Declares the command belongs to the 'avpops' module, accepts a 'name' parameter, requires 'mi.write' permission, and is categorized under 'avpops'.
    _r("avp_delete", "avpops", "Delete an AVP", ["name"], "mi.write", "avpops")
  • The avpops_tools module (containing avp_delete) is imported in server.py, which causes the @mcp.tool() decorator to register avp_delete with the FastMCP server instance.
    from opensips_mcp.tools import avpops_tools as _avpops_tools  # noqa: E402, F401
  • The @audited decorator wraps avp_delete to log audit entries (operation name, params, result status, role) on every invocation.
    def audited(operation: str):
        """Decorator that logs audit entries for tool calls."""
    
        def decorator(func):
            @wraps(func)
            async def wrapper(ctx: Context, *args, **kwargs):
                app = ctx.request_context.lifespan_context
                role = getattr(app.settings, "role", "unknown")
                try:
                    result = await func(ctx, *args, **kwargs)
                    audit_log(operation, kwargs, "success", role)
                    return result
                except Exception as e:
                    audit_log(operation, kwargs, f"error: {e}", role)
                    raise
    
            return wrapper
    
        return decorator
  • The 'avp_delete' entry in migration rules for 2.4→3.0. Lists the avp_delete script function as deprecated, recommending 'unset($avp(name))' instead. This is a config migration reference, not the MCP tool.
    "avp_delete": None,   # deprecated, prefer unset($avp(name))
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only states 'Delete' (implying mutation) but fails to describe effects like idempotency, error handling (e.g., attempting to delete a non-existent AVP), or whether the action is reversible. No output schema details are mentioned.

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

Conciseness4/5

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

The description is a single, efficient sentence with no unnecessary words. It is front-loaded with the key information. However, it could be slightly expanded to include parameter details without losing conciseness.

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?

Despite low complexity (one required parameter), the description omits important context: parameter semantics, return value (output schema exists but not explained), and behavioral guarantees. This leaves the agent with insufficient information to invoke the tool confidently.

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?

The sole parameter 'name' lacks a schema description (0% coverage). The description adds no meaning beyond the parameter name – it does not explain what 'name' refers to (e.g., AVP key format, uniqueness constraints).

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 'Delete a global AVP.' uses a specific verb ('Delete') and resource ('AVP' – attribute-value pair), and clarifies scope ('global'). It clearly differentiates from siblings avp_get and avp_set by focusing on deletion.

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 information is provided about when to use this tool versus alternatives like avp_get or avp_set. There is no mention of prerequisites, when-not to use it, or which sibling to prefer.

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