Skip to main content
Glama

list_twilio_subaccounts

Retrieve all Twilio subaccounts or filter them by friendly name to manage and organize your Twilio account structure effectively.

Instructions

List all Twilio subaccounts or filter by friendly name. Provide an empty string for all subaccounts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'list_twilio_subaccounts' tool using @mcp.tool decorator.
    @mcp.tool( name="list_twilio_subaccounts", description="List all Twilio subaccounts or filter by friendly name. Provide an empty string for all subaccounts", )
  • Handler function for the tool that delegates to AsyncTwilioManager.list_subaccounts()
    async def list_all_twilio_subaccounts() -> list[dict]: """ List all Twilio subaccounts or filter by friendly name. Args: friendly_name: Optional filter by friendly name (empty string for all) Returns: List of subaccount details """ async with async_twilio_manager: return await async_twilio_manager.list_subaccounts()
  • Core implementation in AsyncTwilioManager.list_subaccounts that queries the Twilio API for subaccounts.
    async def list_subaccounts( self, friendly_name: Optional[str] = None, with_token: bool = False ) -> List[Dict]: """ List all subaccounts or filter by friendly name. Args: friendly_name: Optional filter by friendly name Returns: List of subaccount details """ try: params = {} if friendly_name: params["friendly_name"] = friendly_name accounts = await self.client.api.v2010.accounts.list_async(**params) return [ { "sid": account.sid, "friendly_name": account.friendly_name, "auth_token": account.auth_token if with_token else None, } for account in accounts ] except Exception as e: self.logger.error(f"Failed to list subaccounts: {str(e)}") raise

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