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:
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| active | No | Is this destination active | |
| callhunt | No | Is it ring all group number | |
| destination | Yes | Destination for DID | |
| number | Yes | DID Number | |
| transport | No | Transport 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