Skip to main content
Glama
errajibadr

TwilioManager MCP

by errajibadr

get_all_phone_numbers

Retrieve all phone numbers linked to a Twilio subaccount for management and oversight purposes.

Instructions

Get all phone numbers associated with a Twilio subaccount

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_account_sidYes
phone_number_sidYes
target_account_sidYes

Implementation Reference

  • Registration of the MCP tool named 'get_all_phone_numbers' via the @mcp.tool decorator.
    @mcp.tool(
        name="get_all_phone_numbers",
        description="Get all phone numbers associated with a Twilio subaccount",
    )
  • Handler function decorated for 'get_all_phone_numbers' tool. Note: Functionally transfers a phone number despite tool name and description suggesting retrieval of phone numbers.
    async def transfer_phone_number(
        source_account_sid: str,
        phone_number_sid: str,
        target_account_sid: str,
    ) -> dict:
        """
        Transfer a phone number from one Twilio subaccount to another
        Args:
            source_account_sid: The SID of the Twilio subaccount to transfer the phone number from
            phone_number_sid: The SID of the phone number to transfer
            target_account_sid: The SID of the Twilio subaccount to transfer the phone number to
        Returns:
            Dictionary containing the transfer details
        """
        async with async_twilio_manager:
            return await async_twilio_manager.transfer_phone_number(
                source_account_sid, phone_number_sid, target_account_sid
            )
  • Helper function that implements retrieval of all phone numbers for the main Twilio account, matching the expected tool name and description, but not registered as an MCP tool.
    async def get_all_phone_numbers() -> list[dict]:
        """
        Get all phone numbers associated with a Twilio subaccount
        """
        async with async_twilio_manager:
            return await async_twilio_manager.get_account_numbers()
  • Core implementation of phone number transfer logic delegated by the MCP tool handler from AsyncTwilioManager class.
    async def transfer_phone_number(
        self,
        source_account_sid: str,
        phone_number_sid: str,
        target_account_sid: str,
        address_sid: Optional[str] = None,
        bundle_sid: Optional[str] = None,
    ) -> Dict:
        """
        Transfer a phone number to a different subaccount.
    
        Args:
            source_account_sid: The source subaccount SID
            phone_number_sid: The SID of the phone number to transfer
            target_account_sid: The target subaccount SID
            address_sid: The address SID
            bundle_sid: The bundle SID
    
        Returns:
            Dict containing the updated phone number information
        """
        try:
            # Get or create bundle if not provided
            bundle_sid = await self._get_or_create_bundle(
                bundle_sid, phone_number_sid, source_account_sid, target_account_sid
            )
    
            # Get or create address if not provided
            address_sid = await self._get_or_create_address(address_sid, target_account_sid)
    
            return await self._execute_number_transfer(
                source_account_sid, phone_number_sid, target_account_sid, address_sid, bundle_sid
            )
    
        except Exception as e:
            self.logger.error(f"Failed to transfer phone number: {str(e)}")
            raise
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states a read operation ('Get'), implying it's likely non-destructive, but doesn't disclose behavioral traits such as authentication needs, rate limits, pagination, error handling, or what 'all' entails (e.g., scope, limits). For a tool with 3 required parameters and no annotation coverage, this is a significant gap in transparency.

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's appropriately sized and front-loaded, with zero waste, 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 complexity (3 required parameters, no annotations, no output schema), the description is incomplete. It lacks details on parameter usage, behavioral context, and output expectations. For a tool that likely involves account and phone number management, more guidance is needed to help an agent use it correctly, especially with sibling tools present.

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?

Schema description coverage is 0%, meaning parameters are undocumented in the schema. The description adds no meaning beyond the schema—it doesn't explain what the parameters (source_account_sid, phone_number_sid, target_account_sid) do, why they're required, or how they relate to 'getting all phone numbers'. With 3 required parameters and no compensation in the description, this fails to provide necessary semantic context.

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 action ('Get') and resource ('all phone numbers associated with a Twilio subaccount'), providing specific verb+resource pairing. However, it doesn't explicitly differentiate from sibling tools like 'get_account_phone_numbers' or 'list_twilio_subaccounts', which likely have overlapping functionality. The purpose is clear but lacks sibling distinction.

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, context for selecting this over siblings like 'get_account_phone_numbers', or any exclusions. Usage is implied by the name and description alone, with no explicit when/when-not 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