Skip to main content
Glama
UserAd

didlogic_mcp

add_destination

Add a DID destination to a specified number on the didlogic_mcp server, configuring callhunt, active status, transport type (SIP, PSTN, or SIP account), and destination.

Instructions

Add a DID destination.

Args: number: DID number in DIDLogic callhunt: flag indicates do destination is part of ring all group active: flag indicates is destination enabled or not transport: transport of destination where: 1 = SIP address destination (ex: 123@example.com) 4 = PSTN (phone number) destination (ex: 15551231233) 5 = SIP account destination (ex: 12345) destination: destination

Returns a JSON object with did destination where: id: ID of destination destination: destination priority: priority of selection callhunt: flag indicates do destination is part of ring all group active: flag indicates is destination enabled or not transport: transport of destination where: 1 = SIP address destination (ex: 123@example.com) 4 = PSTN (phone number) destination (ex: 15551231233) 5 = SIP account destination (ex: 12345)

Example:

{
    "did_destination": {
        "id": 1234455,
        "destination": "12345",
        "priority": 1,
        "callhunt": false,
        "active": true,
        "transport": 5
    }
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activeNoIs this destination active
callhuntNoIs it ring all group number
destinationYesDestination for DID
numberYesDID Number
transportNoTransport for destination

Implementation Reference

  • The handler function decorated with @mcp.tool(), defining and registering the 'add_destination' tool. It adds a destination to a DID number by posting to the DIDLogic API, including input schema via Pydantic Fields and comprehensive docstring for usage.
    @mcp.tool()
    async def add_destination(
        ctx: Context,
        number: str | int = Field(description="DID Number"),
        callhunt: bool = Field(
            description="Is it ring all group number", default=False
        ),
        active: bool = Field(
            description="Is this destination active", default=False
        ),
        transport: int = Field(
            description="Transport for destination", default=1
        ),
        destination: str | int = Field(description="Destination for DID")
    ) -> str:
        """
            Add a DID destination.
    
            Args:
                number: DID number in DIDLogic
                callhunt: flag indicates do destination is part of ring all group
                active: flag indicates is destination enabled or not
                transport: transport of destination where:
                    1 = SIP address destination (ex: 123@example.com)
                    4 = PSTN (phone number) destination (ex: 15551231233)
                    5 = SIP account destination (ex: 12345)
                destination: destination
    
            Returns a JSON object with did destination where:
                id: ID of destination
                destination: destination
                priority: priority of selection
                callhunt: flag indicates do destination is part of ring all group
                active: flag indicates is destination enabled or not
                transport: transport of destination where:
                    1 = SIP address destination (ex: 123@example.com)
                    4 = PSTN (phone number) destination (ex: 15551231233)
                    5 = SIP account destination (ex: 12345)
    
            Example:
            ```
            {
                "did_destination": {
                    "id": 1234455,
                    "destination": "12345",
                    "priority": 1,
                    "callhunt": false,
                    "active": true,
                    "transport": 5
                }
            }
            ```
        """
        data = {
            "destination[callhunt]": int(callhunt),
            "destination[active]": int(active),
            "destination[transport]": transport,
            "destination[destination]": destination
        }
        response = await base.call_didlogic_api(
            ctx, "POST", f"/v1/purchases/{number}/destinations",
            data=data
        )
        return response.text

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