Skip to main content
Glama
UserAd

didlogic_mcp

list_country_regions

Retrieve available regions with DIDs for purchase by specifying a country ID and optional SMS functionality. Returns a JSON object detailing region IDs, names, and short codes. Access through the didlogic_mcp server.

Instructions

List country regions with available DIDs for purchase

Args: country_id: ID of country for search sms_enabled: search for DID with SMS functionality

Returns a JSON object with available regions for purchase. Returned countries list have following fields: id: ID of region name: Name of region in DIDLogic short_name: short code for region

403 error indicates disabled API calls for purchase.

Example:

{
    "regions": [
        {
            "id": 1,
            "name": "Alberta",
            "short_name": "AB"
        }
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
country_idYesCountry ID
sms_enabledNoFilter for sms enabled numbers

Implementation Reference

  • The core handler function for the 'list_country_regions' tool. It takes country_id and optional sms_enabled filter, calls the DIDLogic API via base.call_didlogic_api, and returns the JSON response as string.
    @mcp.tool()
    async def list_country_regions(
        ctx: Context,
        country_id: int = Field(description="Country ID"),
        sms_enabled: Optional[bool] = Field(
            description="Filter for sms enabled numbers", default=None
        )
    ) -> str:
        """
            List country regions with available DIDs for purchase
    
            Args:
                country_id: ID of country for search
                sms_enabled: search for DID with SMS functionality
    
            Returns a JSON object with available regions for purchase.
            Returned countries list have following fields:
                id: ID of region
                name: Name of region in DIDLogic
                short_name: short code for region
    
            403 error indicates disabled API calls for purchase.
    
            Example:
            ```
            {
                "regions": [
                    {
                        "id": 1,
                        "name": "Alberta",
                        "short_name": "AB"
                    }
            }
            ```
        """
        params = {}
        if sms_enabled is not None:
            params["sms_enabled"] = int(sms_enabled)
    
        response = await base.call_didlogic_api(
            ctx,
            "GET",
            f"/v2/buy/countries/{country_id}/regions",
            params=params
        )
        return response.text
  • Registers all tools from the purchase module, including list_country_regions, with the MCP server.
    tools.purchase.register_tools(mcp)
  • Input schema defined using Pydantic Field for parameters country_id (required int) and sms_enabled (optional bool). Output is str (JSON).
    async def list_country_regions(
        ctx: Context,
        country_id: int = Field(description="Country ID"),
        sms_enabled: Optional[bool] = Field(
            description="Filter for sms enabled numbers", default=None
        )
    ) -> str:
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing the return format (JSON object with regions), field details (id, name, short_name), and error behavior (403 indicates disabled API calls). It doesn't mention rate limits, authentication needs, or pagination, but covers key behavioral aspects.

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 purpose statement, args section, returns explanation, error note, and example. It's appropriately sized but could be slightly more concise by integrating the example more tightly. Most sentences earn their place, though the returns section is somewhat redundant with the example.

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 no annotations, no output schema, and 2 parameters with full schema coverage, the description provides good contextual completeness. It covers purpose, parameters, return format, error handling, and includes an example. It lacks details on authentication or rate limits, but is largely sufficient for this read-only list tool.

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 thoroughly. The description adds minimal value beyond the schema by briefly mentioning 'search for DID with SMS functionality' for sms_enabled, but doesn't provide additional syntax or format details. Baseline 3 is appropriate.

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 verb 'List' and resource 'country regions with available DIDs for purchase', specifying the exact scope. It distinguishes from siblings like list_countries (countries vs regions) and list_country_cities (cities vs regions) by focusing on regions with purchasable DIDs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when searching for regions with purchasable DIDs, but lacks explicit guidance on when to use this tool versus alternatives like list_countries or list_country_cities. No exclusions or prerequisites are mentioned, though the 403 error note provides some operational context.

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