twilio-lookup-phone-intelligence — Claude skill: phone number checks
A Claude and Claude skill that validates phone numbers through Twilio Lookup v2 and scores fraud risk before you send an SMS or place a call.
npx skills add openai/plugins --skill twilio-lookup-phone-intelligence -a codexWhat twilio-lookup-phone-intelligence does
The skill hands your agent Twilio Lookup v2. Basic validation returns whether a number is valid, its E.164 form, national format and country code. When valid comes back false, validationErrors explains why, so you can branch instead of firing off a message.
Paid data packages go through the fields parameter, and several can ride in one call: line_type_intelligence separates mobile, landline, VoIP and toll-free, sim_swap flags a swapped SIM, caller_name returns the subscriber name, identity_match checks ownership, sms_pumping_risk scores SMS pumping. There is also reassigned_number for recycled numbers. The skill ships Python and Node.js examples.
You need a Twilio account, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in the environment, and the SDK: pip install twilio or npm install twilio. Two catches worth knowing up front. caller_name only covers US numbers, and sim_swap returns error 60606 until carrier registration is approved. Caller name requests are billed even when no data comes back. One number per API call, so bulk work means a loop.
What it helps with
- validate a number before sending an SMS
- filter out VoIP lines when routing calls
- score SMS pumping risk before a bulk send
- catch SIM swaps during account login
- match a number owner against user records
Example prompts for the agent
- check +15108675310 and tell me whether it's valid
- fetch line_type_intelligence and sim_swap for this number
- score sms_pumping_risk before I send the campaign
How to install twilio-lookup-phone-intelligence
1Skills CLI (Vercel)
npx skills add openai/plugins --skill twilio-lookup-phone-intelligence -a codex2Manually: put the files in place
.agents/skills/twilio-lookup-phone-intelligence/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add openai/plugins --skill twilio-lookup-phone-intelligence -a claude-code2Manually: put the files in place
~/.claude/skills/twilio-lookup-phone-intelligence/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/twilio-lookup-phone-intelligence/
Manually: put the files in place
.cursor/skills/twilio-lookup-phone-intelligence/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install openai/plugins twilio-lookup-phone-intelligence2Manually: put the files in place
.github/skills/twilio-lookup-phone-intelligence/SKILL.mdPlatform CLI
gemini skills install https://github.com/openai/plugins --path plugins/twilio-developer-kit/skills/twilio-lookup-phone-intelligenceManually: put the files in place
.devin/skills/twilio-lookup-phone-intelligence/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: Codex skills: how to install, where they live, how to call them
Questions about twilio-lookup-phone-intelligence
How do I install twilio-lookup-phone-intelligence in Claude?
Run npx skills add openai/plugins --skill twilio-lookup-phone-intelligence -a codex, then the skill file lands at .agents/skills/twilio-lookup-phone-intelligence/SKILL.md.
What does twilio-lookup-phone-intelligence do?
It validates phone numbers through Twilio Lookup v2 and, on request, pulls data packages: line type, SIM swap, caller name, identity match and SMS pumping risk.
Which data packages are available and where do they fail?
line_type_intelligence and sms_pumping_risk cover worldwide, caller_name and reassigned_number are US only, sim_swap and identity_match cover select regions. SIM swap needs carrier registration or you get error 60606.
Source text
SKILL.md · MIT
---
name: twilio-lookup-phone-intelligence
description: >
Look up phone number intelligence via Twilio Lookup v2 API. Covers number
validation, line type detection (mobile/landline/VoIP), SIM swap detection,
caller name, identity match, and SMS pumping risk scoring. Use this skill
to validate numbers or assess fraud risk before sending messages or calls.
---
## Overview
Twilio Lookup validates phone numbers and provides optional intelligence packages. Basic validation is free; data packages (line type, SIM swap, etc.) are paid per lookup.
---
## Prerequisites
- Twilio account (free trial works for basic lookups)
— New to Twilio? See `twilio-account-setup`
- Environment variables:
- `TWILIO_ACCOUNT_SID`
- `TWILIO_AUTH_TOKEN`
— See `twilio-iam-auth-setup` for credential setup and best practices
- SDK: `pip install twilio` / `npm install twilio`
---
## Quickstart
**Python**
```python
import os
from twilio.rest import Client
client = Client(os.environ["TWILIO_ACCOUNT_SID"], os.environ["TWILIO_AUTH_TOKEN"])
phone = client.lookups.v2.phone_numbers("+15108675310").fetch()
print(phone.valid) # True / False
print(phone.phone_number) # +15108675310 (E.164)
print(phone.national_format) # (510) 867-5310
print(phone.country_code) # US
```
**Node.js**
```node
const twilio = require("twilio");
const client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);
const phone = await client.lookups.v2.phoneNumbers("+15108675310").fetch();
console.log(phone.valid);
console.log(phone.phoneNumber);
console.log(phone.nationalFormat);
```
If `valid` is `false`, check `phone.validationErrors` for the reason.
---
## Key Patterns
### Line Type Intelligence (paid)
Identifies mobile, landline, VoIP, toll-free, etc.
**Python**
```python
phone = client.lookups.v2.phone_numbers("+15108675310").fetch(
fields="line_type_intelligence"
)
print(phone.line_type_intelligence)
# {'type': 'mobile', 'carrier_name': 'T-Mobile USA', ...}
```
**Node.js**
```node
const phone = await client.lookups.v2.phoneNumbers("+15108675310").fetch({
fields: "line_type_intelligence",
});
console.log(phone.lineTypeIntelligence);
```
Line types: `mobile`, `landline`, `voip`, `toll-free`, `fixedVoip`, `nonFixedVoip`, `personal`, `payphone`, `unknown`
### Multiple Packages in One Request
**Python**
```python
phone = client.lookups.v2.phone_numbers("+15108675310").fetch(
fields="line_type_intelligence,sim_swap,caller_name"
)
```
**Node.js**
```node
const phone = await client.lookups.v2.phoneNumbers("+15108675310").fetch({
fields: "line_type_intelligence,sim_swap,caller_name",
});
```
### Validate Before Sending
**Python**
```python
phone = client.lookups.v2.phone_numbers("+invalid").fetch()
if not phone.valid:
print(f"Invalid number: {phone.validation_errors}")
# Handle gracefully — do not attempt to send
```
**Node.js**
```node
const phone = await client.lookups.v2.phoneNumbers("+invalid").fetch();
if (!phone.valid) {
console.log("Invalid number:", phone.validationErrors);
}
```
### Available Data Packages
| Package | `fields` value | Coverage | Use case |
|---------|---------------|----------|----------|
| Line Type Intelligence | `line_type_intelligence` | Worldwide | Route by line type; block VoIP |
| Caller Name | `caller_name` | US only | Show caller ID |
| SIM Swap | `sim_swap` | Select regions | Fraud detection |
| Identity Match | `identity_match` | Select regions | Verify ownership |
| SMS Pumping Risk | `sms_pumping_risk` | Worldwide | Fraud prevention |
| Reassigned Number | `reassigned_number` | US only | Check if recycled |
---
## Common Errors
| Code | Meaning | Fix |
|------|---------|-----|
| 20404 | Phone number not found | Number may be invalid or unsupported format |
| 60601 | Data package not available for this region | Check regional coverage before requesting package |
---
## CANNOT
- **Cannot look up by name or address** — Input is always a phone number. No reverse search.
- **Cannot get caller_name for non-US numbers** — Returns error 60600 (out of coverage).
- **Cannot detect conditional call forwarding** — Only unconditional forwarding is detected, and only for UK carriers.
- **Cannot guarantee SIM swap data without carrier registration** — Returns error 60606 until carrier approval is in place.
- **Cannot use Reassigned Number outside the US** — US-only dataset with monthly update cadence.
- **Cannot get real-time SMS pumping scores** — Scores are statistical models, not live traffic analysis.
- **Cannot write data** — Lookup v2 is read-only (GET only). The one exception is Line Type Override (POST/DELETE).
- **Cannot batch multiple phone numbers in one request** — One number per API call. Loop for bulk lookups.
- **Cannot avoid billing on caller_name requests that return no data** — Billed per request regardless of whether data is returned.
- **Cannot use Phone Number Quality Score or Pre-fill without provisioning** — Returns 60606. Contact Twilio sales to enable.
- **Cannot guarantee deliverability from a valid lookup** — A valid number may still be unreachable (carrier issues, ported, etc.)
---
## Next Steps
- **Send SMS after validation:** `twilio-sms-send-message`
- **Send OTP after validation:** `twilio-verify-send-otp`
© Twilio · MIT · openai/plugins