Skip to main content
Glama
errajibadr

TwilioManager MCP

by errajibadr

get_account_phone_numbers

Retrieve all phone numbers linked to a Twilio subaccount using its Account SID for management and oversight.

Instructions

Get all phone numbers associated with a Twilio subaccount

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_sidYes

Implementation Reference

  • The MCP tool handler function that executes the get_account_phone_numbers tool logic. It takes account_sid and delegates to AsyncTwilioManager.get_account_numbers.
    async def get_account_phone_numbers_for_subaccount(account_sid: str) -> list[dict]:
        """
        Get all phone numbers associated with a Twilio subaccount
        Args:
            account_sid: The SID of the Twilio subaccount
        Returns:
            List of phone numbers and their details
        """
        async with async_twilio_manager:
            return await async_twilio_manager.get_account_numbers(account_sid)
  • The @mcp.tool decorator registration for the get_account_phone_numbers tool.
    @mcp.tool(
        name="get_account_phone_numbers",
        description="Get all phone numbers associated with a Twilio subaccount",
    )
  • The core helper method in AsyncTwilioManager that fetches local and mobile incoming phone numbers from Twilio API for the given account_sid.
    async def get_account_numbers(self, account_sid: Optional[str] = None) -> List[Dict]:
        """
        Get all phone numbers associated with a subaccount.
    
        Args:
            account_sid: The subaccount SID
    
        Returns:
            List of phone numbers and their details
        """
        try:
            numbers = []
            if account_sid:
                local_numbers = await self.client.api.v2010.accounts(
                    account_sid
                ).incoming_phone_numbers.local.list_async()
                mobile_numbers = await self.client.api.v2010.accounts(
                    account_sid
                ).incoming_phone_numbers.mobile.list_async()
            else:
                local_numbers = await self.client.incoming_phone_numbers.local.list_async()
                mobile_numbers = await self.client.incoming_phone_numbers.mobile.list_async()
    
            numbers.extend(
                [{**number.__dict__, "number_type": "national"} for number in local_numbers]
            )
            numbers.extend(
                [{**number.__dict__, "number_type": "mobile"} for number in mobile_numbers]
            )
            return numbers
    
        except Exception as e:
            self.logger.error(f"Failed to fetch phone numbers: {str(e)}")
            raise
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Get') but doesn't describe what 'Get all phone numbers' entails—e.g., whether it returns a list, includes pagination, requires specific permissions, or has rate limits. This is a significant gap for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized, making it easy to parse quickly.

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 lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It doesn't address behavioral aspects like return format, error handling, or usage constraints, which are crucial for a tool with one required parameter and no structured guidance.

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

Parameters2/5

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

The input schema has 0% description coverage, so the description must compensate. It mentions 'account_sid' implicitly but doesn't explain what this parameter represents, its format, or how to obtain it. Without this additional semantic information, the agent lacks context for proper usage.

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 verb ('Get') and resource ('all phone numbers associated with a Twilio subaccount'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_all_phone_numbers', which might have overlapping functionality, so it doesn't reach the highest score.

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 like 'get_all_phone_numbers' or 'list_twilio_subaccounts'. It lacks context about prerequisites, such as whether the account_sid must be for a subaccount specifically, or any exclusions. This leaves the agent without clear usage instructions.

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/errajibadr/twilio_manager_mcp'

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