npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@getdial/ai-sdk

v0.16.0

Published

Official Dial tools for the Vercel AI SDK — phone numbers, SMS, and AI voice calls for any tool-calling model

Readme

@getdial/ai-sdk

Official Dial tools for the Vercel AI SDK — give any tool-calling model the ability to send SMS and place AI voice calls through Dial.

It's the TypeScript analog of dial-langchain: a thin adapter that wraps the @getdial/sdk client in AI SDK tool() definitions. It adds nothing to the REST contract — it just shapes Dial's operations the way the AI SDK wants them.

Not Vercel-only. The "Vercel AI SDK" is the open-source ai package; it runs on any JS host (Next.js anywhere, Node, Hono, Workers, Deno, Bun) and with any tool-calling model (Claude, GPT, Gemini, …). These tools work wherever it does.

Install

npm install @getdial/ai-sdk ai zod

ai and zod are peer dependencies — your app already has them.

Give the tools to a model

Build one DialClient, pass it to dialTools, and spread the result into the tools field. Every tool shares that one client (a single connection pool). To switch models, change one line; the tools don't change.

import { streamText } from "ai";
import { anthropic } from "@ai-sdk/anthropic";
import { DialClient } from "@getdial/sdk";
import { dialTools } from "@getdial/ai-sdk";

const dial = new DialClient({ apiKey: process.env.DIAL_API_KEY! });

const result = streamText({
  model: anthropic("claude-opus-4-8"), // or openai("gpt-5"), google("gemini-2.5-pro"), …
  tools: dialTools(dial, {
    fromNumberId: process.env.DIAL_FROM_NUMBER_ID, // optional default "from"
  }),
  messages,
});

In a Next.js app this lives in a route handler (app/api/chat/route.ts); the host is irrelevant.

Pick individual tools

When you only want a subset, import the factories directly and pass them the same client:

import { DialClient } from "@getdial/sdk";
import { sendMessageTool, makeCallTool } from "@getdial/ai-sdk";

const dial = new DialClient({ apiKey: process.env.DIAL_API_KEY! });
const tools = {
  sendMessage: sendMessageTool(dial, { fromNumberId: "pn_..." }),
  makeCall: makeCallTool(dial, { fromNumberId: "pn_..." }),
};

Available tools

| Tool | Action | |---|---| | listNumbers | List your phone numbers | | purchaseNumber | Provision a new number (billable) | | setNumberProperties | Update a number's nickname / inbound instruction / voice / duration cap | | sendMessage | Send an SMS (optionally MMS) | | replyToMessage | Reply or react to a message | | listMessages | List recent messages | | makeCall | Place an AI voice call | | listCalls | List recent calls | | getCall | Fetch one call by id | | getBilling | Wallet balance, subscription, per-number mode | | waitForMessage | Block until the next inbound SMS arrives, or time out |

If fromNumberId is set in the options, it's the default for sendMessage and makeCall — the model can omit it.

Send a code and await the reply

waitForMessage pairs with sendMessage so the model can verify a number inside a single turn:

const dial = new DialClient({ apiKey: process.env.DIAL_API_KEY! });
const tools = dialTools(dial, { fromNumberId: "pn_..." });

await generateText({
  model,
  tools,
  // The model sends a code via sendMessage, then calls waitForMessage to read the reply.
  prompt: "Text +14155550123 the code 4821, then wait up to 60s for their reply and tell me if it matches.",
});

Notes

  • sendMessage is a write action and isn't idempotent — a re-invoke after a failure can send a duplicate. makeCall accepts an idempotencyKey: re-invoking with the same key returns the already-placed call instead of dialing again.
  • waitForMessage is backed by Dial's presence-based event stream — missed events replay only on reconnect within ~2 minutes. For durable, at-least-once delivery, register a webhook.

See the Vercel AI SDK integration docs for the full guide.