Skip to main content
Glama
UserAd

didlogic_mcp

list_purchases

Retrieve detailed information about purchased DIDs, including number, channels, location, pricing, and SIP codec preferences, with pagination support for easy navigation.

Instructions

List purchased DIDs in DIDLogic

Args: page: page of result starting with 1 per_page: how many results should be on per page

Returns a JSON object with a call history results where: purchases: List of purchased DIDs number: Number of DID channels: How many parallel channels DID have country: Country name area: City name free_minutes: How many free minutes per month DID have activation: Activation cost for DID in USD monthly_fee: Monthly fee for DID per_minute: Per minute cost for DID codec: what SIP codec is preferred for this number check_state: DID state

pagination: Pagination details for results
    page: current page of results
    per_page: results per page
    total_pages: total pages results
    total_records: total query records (maximum 5000)

Example response:

{
    "purchases": [
        {
            "number": "441172999999",
            "channels": 2,
            "country": "United Kingdom",
            "area": "Bristol",
            "codec": "G711",
            "activation": 0.0,
            "monthly_fee": 0.99,
            "per_minute": 0.001,
            "check_state": "checked",
            "free_minutes": 0
        }
    ],
    "pagination": {
        "pages": 1,
        "page": 1,
        "per_page": 100,
        "total_records": 50
    }
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage for purchases
per_pageNoResults per page

Implementation Reference

  • The main handler function for the 'list_purchases' tool. It defines the input parameters with descriptions (schema), documentation, and executes the API call to list purchases with pagination.
    @mcp.tool()
    async def list_purchases(
        ctx: Context,
        page: Optional[int] = Field(
            description="Page for purchases", default=None
        ),
        per_page: Optional[int] = Field(
            description="Results per page", default=None
        )
    ) -> str:
        """
            List purchased DIDs in DIDLogic
    
            Args:
                page: page of result starting with 1
                per_page: how many results should be on per page
    
            Returns a JSON object with a call history results where:
                purchases: List of purchased DIDs
                    number: Number of DID
                    channels: How many parallel channels DID have
                    country: Country name
                    area: City name
                    free_minutes: How many free minutes per month DID have
                    activation: Activation cost for DID in USD
                    monthly_fee: Monthly fee for DID
                    per_minute: Per minute cost for DID
                    codec: what SIP codec is preferred for this number
                    check_state: DID state
    
                pagination: Pagination details for results
                    page: current page of results
                    per_page: results per page
                    total_pages: total pages results
                    total_records: total query records (maximum 5000)
    
            Example response:
            ```
            {
                "purchases": [
                    {
                        "number": "441172999999",
                        "channels": 2,
                        "country": "United Kingdom",
                        "area": "Bristol",
                        "codec": "G711",
                        "activation": 0.0,
                        "monthly_fee": 0.99,
                        "per_minute": 0.001,
                        "check_state": "checked",
                        "free_minutes": 0
                    }
                ],
                "pagination": {
                    "pages": 1,
                    "page": 1,
                    "per_page": 100,
                    "total_records": 50
                }
            }
            ```
        """
        params = {}
        if page is not None:
            params["page"] = page
        if per_page is not None:
            params["per_page"] = per_page
        response = await base.call_didlogic_api(
            ctx, "GET",
            "/v1/purchases",
            params=params
        )
        return response.text
  • Input schema for the list_purchases tool defined using Pydantic Field with descriptions for page and per_page parameters.
        ctx: Context,
        page: Optional[int] = Field(
            description="Page for purchases", default=None
        ),
        per_page: Optional[int] = Field(
            description="Results per page", default=None
        )
    ) -> str:
  • Registration block where tools.purchases.register_tools(mcp) is called to register the list_purchases tool among others.
    tools.balance.register_tools(mcp)
    tools.sip_accounts.register_tools(mcp)
    tools.allowed_ips.register_tools(mcp)
    tools.purchases.register_tools(mcp)
    tools.purchase.register_tools(mcp)
    tools.calls.register_tools(mcp)
    tools.transactions.register_tools(mcp)
  • The register_tools function in the purchases module that defines and registers the tool using @mcp.tool() decorator.
    def register_tools(mcp: FastMCP):
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses pagination behavior and the 5000-record maximum, which are valuable behavioral traits. However, it doesn't mention authentication requirements, rate limits, or whether this is a read-only operation (though 'List' implies reading).

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 well-structured with clear sections (Args, Returns, Example) and front-loads the core purpose. However, the detailed return value documentation could be more concise, and some information (like the exact field names) might be better placed in an output schema if available.

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 the tool's moderate complexity (pagination, structured return data) and no output schema, the description provides comprehensive return value documentation including field meanings and an example. This compensates well for the missing output schema, though authentication and error handling context is absent.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters adequately. The description repeats the parameter names but doesn't add meaningful semantic context beyond what's in the schema (e.g., 'page of result starting with 1' vs schema's 'Page for purchases').

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 as 'List purchased DIDs in DIDLogic' - a specific verb ('List') with resource ('purchased DIDs') and system context ('in DIDLogic'). However, it doesn't explicitly differentiate this from sibling tools like 'list_dids_in_country_city' or 'get_call_history', which might offer overlapping functionality.

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. With sibling tools like 'list_dids_in_country_city', 'get_call_history', and 'list_countries', there's no indication of when this specific purchase-focused listing is appropriate versus other listing/filtering options.

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