Skip to main content

tai42-tools-twilio

License: Apache 2.0

Twilio provisioning tools for the TAI ecosystem — manifest-loaded REST tools that list a Twilio account's incoming phone numbers, read a number's inbound-message webhook, and set a number's inbound-message webhook URL.

All Twilio traffic is direct REST through tai42-kit's curl client (no twilio SDK); requests carry HTTP Basic auth (AccountSid:AuthToken). The package registers its tools through the tai42_app handle from tai42_contract.app and never imports the skeleton.

The TAI ecosystem

TAI is an open-source runtime for MCP tools, agents, and workflows. A tool is a callable the host loads from a plugin manifest; this package supplies the Twilio number-provisioning tools. The ecosystem is open-ended, so this repo is these tools' own full doc home, and the documentation site covers the platform-level story:

The current release line tracks the 7.x contract (tai42-contract>=7,<8).

Install

Requires Python 3.13+. Install from PyPI into the environment that runs the server:

uv add tai42-tools-twilio

Or from source — clone this repo and add it as an editable dependency; the tai42-* dependencies resolve in-tree from the workspace.

git clone https://github.com/tai42ai/tai42   # next to your app checkout
cd /path/to/your/app
uv add --editable ../tai42/plugins/tools-twilio

Catalog

Tool Description
list_twilio_numbers Lists the account's incoming phone numbers, following Twilio's paging to exhaustion, and returns each number's sid, phone_number, sms_url, and sms_method.
get_twilio_number_webhook Reads one number's inbound-message webhook and returns its sid, phone_number, sms_url, and sms_method.
set_twilio_number_webhook Sets a number's inbound-message webhook to an https URL and returns the updated sid, phone_number, and sms_url.

Provisioning a number's inbound webhook

These tools configure the Twilio side of an inbound-message flow: they point a number's "A message comes in" webhook at the platform's inbound endpoint so Twilio POSTs each message there. list_twilio_numbers finds the number's sid, get_twilio_number_webhook reads its current webhook, and set_twilio_number_webhook writes a new one:

{ "sid": "PN...", "phone_number": "+15551234567", "sms_url": "https://app.example/api/channels/twilio/inbound" }

set_twilio_number_webhook requires an https URL and rejects an empty or non-https value before any network call. Every Twilio non-2xx raises loudly with its status and body — never remapped to success — and the Basic-auth header is never echoed into the error.

Configuration

The tools read the same CHANNEL_TWILIO_ credentials as the deployment's Twilio channel — one account SID, auth token, and REST base configure both.

Setting Env var Default Purpose
Account SID CHANNEL_TWILIO_ACCOUNT_SID The Twilio account SID. Required.
Auth token CHANNEL_TWILIO_AUTH_TOKEN The Twilio auth token. Required.
API base CHANNEL_TWILIO_API_BASE_URL https://api.twilio.com/2010-04-01 Twilio REST origin (carries the API version prefix).
Request timeout CHANNEL_TWILIO_HTTP_TIMEOUT_SECONDS 30 Per-request timeout.

Credentials live only in the environment. A missing or empty required credential raises loudly (fails closed), naming its env var and never the value.

Development

uv venv --python 3.13
uv pip install --no-sources --extra dev --editable .
uv run --no-sync pytest --cov --cov-report=term-missing
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync pyright

License

Apache-2.0. See LICENSE and NOTICE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tai42_tools_twilio-1.0.10.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tai42_tools_twilio-1.0.10-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file tai42_tools_twilio-1.0.10.tar.gz.

File metadata

  • Download URL: tai42_tools_twilio-1.0.10.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tai42_tools_twilio-1.0.10.tar.gz
Algorithm Hash digest
SHA256 e8c953a0a038ec940c01e6afebae24ee5cff4ec3f4eef5222200a8daed455317
MD5 e211a15d74f5dcab5eea46b7ef9c2d8b
BLAKE2b-256 283bcc046f9fad49982cf27df7ddce0e4f087876f2a6c9b27fed74e2a4ed7cc4

See more details on using hashes here.

File details

Details for the file tai42_tools_twilio-1.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for tai42_tools_twilio-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 9a995340a5510cdfcfb079b81a92241f8e87545a220b6ef674a4d2876e0f02cf
MD5 65d3e8b1f741e72ba7161c8dd5b5a6b6
BLAKE2b-256 4ca3143333abed1ef852757728946180c1671c5b78b493e487abf1b50c2040aa

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.10 This release

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page