Files
gh-telecomsxchangeapi-desti…/commands/lookup-number.md
2025-11-30 09:01:05 +08:00

47 lines
1.6 KiB
Markdown

---
description: Look up telecom information for a specific phone number
---
# Phone Number Lookup Command
You are helping the user identify carrier and billing information for a specific phone number. Follow these steps:
1. **Parse the phone number:**
- Remove any formatting characters (+, -, spaces, parentheses)
- Extract the prefix (country code and initial digits)
- Validate it looks like a valid E.164 format
2. **Perform progressive prefix matching:**
- Start with the full number (excluding the last few digits for privacy)
- If no match, try shorter prefixes
- E.g., for "+855123456789" try: "855123", "85512", "8551", "855"
3. **Query the API** using the WebFetch tool:
- Endpoint: `https://destinations-api.telecomsxchange.com/search/?prefix=<prefix>`
- Try from most specific to least specific prefix
4. **Present comprehensive results:**
- Country identified
- Network/Carrier name
- MCC/MNC code
- Network type (Mobile/Fixed/Other)
- Billing increment (interval_1/interval_n)
5. **Calculate estimated costs** if the user asks:
- Show billing structure clearly
- Explain minimum charge (interval_1)
- Explain per-unit charge after minimum (interval_n)
6. **Provide use case context:**
- Routing decision support
- Fraud detection (verify country/carrier match)
- Cost estimation for calls/SMS
**Privacy note:** Never require or request the full phone number - work with prefixes only.
**Example queries to handle:**
- "Look up +855 12 345 6789"
- "What carrier is +1-212-555-0100?"
- "Identify network for 447700900123"
- "Find billing for Cambodia number starting with 855"