Skip to main content
Glama
UserAd

didlogic_mcp

list_sip_accounts

Retrieve detailed information of all SIP accounts, including IDs, names, caller IDs, usage metrics, IP restrictions, call limits, and creation dates, returned in JSON format.

Instructions

List all SIP accounts

Returns a JSON object with all SIP accounts where: id: ID of SIP account name: SIP account name (login) callerid: CallerID associated with this SIP account label: label fot this SIP account charge: charge for calls on this month talk_time: total talk time for this month rewrite_enabled: do SIP account have calling number rewriting rule rewrite_cond: prefix to be rewrited (ex: 00) rewrite_prefix: prefix to what should be rewritten (ex: 44) didinfo_enabled: do DIDLogic will attempt send DID number as TO when receiving calls to this account ip_restrict: do we need to allowlist IP addresses for this account allowed_ips: IP addresses allowed for this SIP account call_restrict: flag indicates what SIP account should have maximum call time call_limit: maximum call duration in seconds channels_restrict: flag indicates what SIP account should have maximum channels limit max_channels: maximum sip channels cost_limit: flag indicates what SIP account should have maximum call cost max_call_cost: maximum call cost for this SIP account created_at: date of creation this SIP account

Example:

{
    "sipaccounts": [
        {
            "id": 61,
            "name": "12345",
            "callerid": "17254999999",
            "label": "TEST DEVICE",
            "host": "dynamic",
            "charge": "0.0",
            "talk_time": 0,
            "rewrite_enabled": false,
            "rewrite_cond": "8",
            "rewrite_prefix": "7",
            "didinfo_enabled": false,
            "ip_restrict": false,
            "call_restrict": true,
            "call_limit": 2800,
            "channels_restrict": false,
            "max_channels": 1,
            "cost_limit": false,
            "max_call_cost": "5.0",
            "created_at": "2024-06-03 06:06:47 UTC",
            "allowed_ips": ["1.2.3.4", "3.4.5.6"]
        }
    ]
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the list_sip_accounts tool by calling the DidLogic API to retrieve and return a JSON list of all SIP accounts.
    @mcp.tool()
    async def list_sip_accounts(ctx: Context) -> str:
        """
            List all SIP accounts
    
            Returns a JSON object with all SIP accounts where:
                id: ID of SIP account
                name: SIP account name (login)
                callerid: CallerID associated with this SIP account
                label: label fot this SIP account
                charge: charge for calls on this month
                talk_time: total talk time for this month
                rewrite_enabled: do SIP account have calling number rewriting rule
                rewrite_cond: prefix to be rewrited (ex: 00)
                rewrite_prefix: prefix to what should be rewritten (ex: 44)
                didinfo_enabled: do DIDLogic will attempt send DID number as TO when receiving calls to this account
                ip_restrict: do we need to allowlist IP addresses for this account
                allowed_ips: IP addresses allowed for this SIP account
                call_restrict: flag indicates what SIP account should have maximum call time
                call_limit: maximum call duration in seconds
                channels_restrict: flag indicates what SIP account should have maximum channels limit
                max_channels: maximum sip channels
                cost_limit: flag indicates what SIP account should have maximum call cost
                max_call_cost: maximum call cost for this SIP account
                created_at: date of creation this SIP account
    
            Example:
            ```
            {
                "sipaccounts": [
                    {
                        "id": 61,
                        "name": "12345",
                        "callerid": "17254999999",
                        "label": "TEST DEVICE",
                        "host": "dynamic",
                        "charge": "0.0",
                        "talk_time": 0,
                        "rewrite_enabled": false,
                        "rewrite_cond": "8",
                        "rewrite_prefix": "7",
                        "didinfo_enabled": false,
                        "ip_restrict": false,
                        "call_restrict": true,
                        "call_limit": 2800,
                        "channels_restrict": false,
                        "max_channels": 1,
                        "cost_limit": false,
                        "max_call_cost": "5.0",
                        "created_at": "2024-06-03 06:06:47 UTC",
                        "allowed_ips": ["1.2.3.4", "3.4.5.6"]
                    }
                ]
            }
            ```
        """
        response = await base.call_didlogic_api(ctx, "GET", "/v1/sipaccounts")
        return response.text
  • Registration of the sip_accounts tools (including list_sip_accounts) by invoking register_tools on the FastMCP server instance.
    tools.sip_accounts.register_tools(mcp)
  • Shared helper function call_didlogic_api used by the handler to make authenticated HTTP requests to the DidLogic API endpoints.
    async def call_didlogic_api(
        ctx: Context,
        method: str,
        path: str,
        params: Optional[Dict] = None,
        data: Optional[Dict] = None,
        json: Optional[Dict] = None
    ) -> httpx.Response:
        """
        Make a call to the Didlogic API.
    
        In HTTP/SSE mode, extracts Bearer token from request context and adds it
        to the Authorization header for each API call.
        In STDIO mode, uses the API key already configured in the client headers.
        """
        client = ctx.request_context.lifespan_context.client
    
        # In HTTP/SSE mode, get API key from request.state (set by middleware)
        extra_headers = {}
    
        # Check if we have a request object (indicates HTTP/SSE mode)
        request = getattr(ctx.request_context, "request", None)
    
        if request and hasattr(request, 'state') and hasattr(request.state, 'didlogic_api_key'):
            # HTTP/SSE mode: extract API key from request state
            api_key = request.state.didlogic_api_key
            if api_key:
                extra_headers["Authorization"] = f"Bearer {api_key}"
                logger.debug(f"Using API key from request state: {api_key[:8]}...")
            else:
                logger.warning("No API key found in request state")
        else:
            # STDIO mode: API key already in client headers from lifespan
            logger.debug("Using API key from client headers (STDIO mode)")
    
        response = await client.request(
            method=method,
            url=path,
            params=params,
            data=data,
            json=json,
            headers=extra_headers
        )
        response.raise_for_status()
        return response
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the return format (JSON object with detailed fields) and includes an example, which helps understand behavior. However, it lacks critical details like pagination, error handling, rate limits, or authentication requirements, leaving gaps for a tool with no annotations.

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

Conciseness3/5

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

The description is front-loaded with the purpose but becomes verbose by listing all return fields and including a full example. While the example is helpful, the field explanations could be more concise. Some sentences (like the field list) are necessary but lengthy, reducing efficiency.

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

Completeness4/5

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

Given 0 parameters, no annotations, and no output schema, the description compensates well by detailing the return structure and providing an example. It covers what the tool does and what to expect in response. However, it misses behavioral aspects like error cases or performance considerations, keeping it from a perfect score.

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 tool has 0 parameters, and schema description coverage is 100% (empty schema). The description doesn't need to add parameter details, so it appropriately focuses on output. It provides extensive semantics for the returned fields (e.g., explaining 'rewrite_enabled' and 'call_limit'), which is valuable beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List all SIP accounts' with a specific verb ('List') and resource ('SIP accounts'). It distinguishes from siblings like 'get_sip_account' (singular) and 'update_sip_account' by indicating it returns all accounts. However, it doesn't explicitly contrast with other list tools (e.g., 'list_destinations'), leaving some ambiguity.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication), compare with 'get_sip_account' for single accounts, or specify scenarios where listing all accounts is appropriate. Usage is implied from the name but not articulated.

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

Related 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/UserAd/didlogic_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server