Skip to content
PluginStats

ai-tool-set weekly downloads statistics

By zirkelc (4 listings) · npm · AI SDKs

Conditional tool activation for the AI SDK, fully type-safe

View on npm Fresh · Dec 6, 2026

ai-tool-set has 790 recorded weekly downloads on npm, a decrease of 23.4% over the past 30 days, ranking #2143 of 3,247 tracked listings.

Weekly downloads
790
Official API · Dec 5, 2026
7-day growth
-55.1%
-969 weekly downloads
30-day growth
-23.4%
-241 weekly downloads
90-day growth
+139%
+460 weekly downloads
Rank
#2143
▼ 321 in 7 days

About ai-tool-set

<div align='center'> <picture> <source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.png" /> <img src="assets/logo-light.png" alt="ai-tool-set logo" width="400" /> </picture> <p align="center"> Conditional tool activations and approvals for the AI SDK, fully type-safe <br/> by <a href="https://x.com/zirkelc">@zirkelc</a> </p> <p align="center"> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/github/license/zirkelc/ai-tool-set" alt="License"></a> <a href="https://www.npmjs.com/package/ai-tool-set"><img src="https://img.shields.io/npm/dw/ai-tool-set" alt="Weekly downloads"></a> <a href="https://www.npmjs.com/package/ai-tool-set"><img src="https://img.shields.io/npm/dt/ai-tool-set" alt="Total downloads"></a> <a href="https://github.com/zirkelc/ai-tool-set"><img src="https://img.shields.io/github/stars/zirkelc/ai-tool-set" alt="GitHub stars"></a> </p> </div>

This library provides a type-safe API to manage activeTools, toolApproval, and toolChoice for generateText() and streamText() in the AI SDK.

Why?

The AI SDK gives you activeTools, toolApproval and toolChoice to control which tools the model can use, which tool calls need approval, and which tool the model must call. But you must compute these values yourself for each call and for each step. This becomes complex when the values depend on the conversation, on the previous steps or on your own context, for example a tool that is available only to admins, or only after the user asks for it.

ai-tool-set lets you declare these rules once, on the standard AI SDK tool() definitions. Then .inferTools() resolves activeTools, toolApproval, toolChoice and toolOrder for any AI SDK function.

Features
  • Static activation: Turn tools on or off with .activate() and .deactivate().
  • Conditional activation: Turn tools on or off from the messages, the steps or your own context with .activateWhen() and .deactivateWhen().
  • Activation reasons: Give each activation a reason, and tell the model why a tool is not available.
  • Tool approval: Approve, deny or ask the user for each tool with .approve(), .deny() and .approval().
  • Tool choice: Force a specific tool, any tool or no tool with .choice().
  • Stable tool order: Keep the static tools in a fixed prefix, so that the provider prompt cache stays valid when a conditional tool changes.
  • Per step: Resolve all values again for each step in prepareStep.
  • Type-safe: Tool names are checked at compile time and at runtime, and the Infer* types show which tools are active, inactive or conditional.
Installation

[!NOTE] Version compatibility:

npm install ai-tool-set@1 # AI SDK v6
npm install ai-tool-set@2 # AI SDK v7

Usage

Creating a Tool Set

Pass a plain record of AI SDK tool() definitions to createToolSet(). All tools are active by default.

import { tool } from 'ai';
import { z } from 'zod';
import { createToolSet } from 'ai-tool-set';

const tools = {
  search: tool({
    description: 'Search for products',
    inputSchema: z.object({ query: z.string() }),
    execute: async ({ query }) => searchProducts(query),
  }),
  list_orders: tool({
    description: 'List orders for a customer',
    inputSchema: z.object({ customerId: z.string() }),
    execute: async ({ customerId }) => listOrders(customerId),
  }),
  cancel_order: tool({
    description: 'Cancel an order',
    inputSchema: z.object({ orderId: z.string() }),
    execute: async ({ orderId }) => cancelOrder(orderId),
  }),
};

const toolSet = createToolSet({ tools });
Activate and Deactivate Tools

Use .activate() and .deactivate() to statically control which tools are available. Call .inferTools() to resolve activeTools and pass into generateText() or streamText():

import { generateText } from 'ai';

// Activate and deactivate tools
const toolSet = createToolSet({ tools }).deactivate(['cancel_order']).activate(['list_orders']);

// Infer active tools
const { tools, activeTools } = toolSet.inferTools();

const result = await generateText({
  model,
  // Pass tools and activeTools:
  tools,
  activeTools,
  // Or spread directly:
  // ...toolSet.deactivate(['cancel_order']).activate(['list_orders']).inferTools(),
  prompt: 'Show me my orders',
});
Conditional Activation

Use .activateWhen() and .deactivateWhen() to conditionally control tools based on messages, step history, and context. The predicate receives an input with messages, steps, and toolSetContext (all can be undefined if not provided to inferTools) and should return a boolean (or undefined) to determine whether the tool should be activated/deactivated.…

Description from the npm listing.

  • ai
  • ai-sdk
  • tools
  • toolset

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

ai-tool-set weekly downloads on npm, last 90 days: 790 weekly downloads as of Dec 5, 2026, +139% over 90 days.ai-tool-setWeekly downloads on npm · Last 90 days790downloads / week+139% over 90 days05001K1.5K2KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
ai-tool-set weekly downloads on npm, last 90 days: 790 weekly downloads as of Dec 5, 2026, +139% over 90 days.

7/30/90-day growth

ai-tool-set weekly downloads growth on npm: -55.1% over 7 days, -23.4% over 30 days, +139% over 90 days.ai-tool-setWeekly downloads growth on npm790downloads / week now7-day growth-969 weekly downloads-55.1%30-day growth-241 weekly downloads-23.4%90-day growth+460 weekly downloads+139%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
ai-tool-set weekly downloads growth on npm: -55.1% over 7 days, -23.4% over 30 days, +139% over 90 days.

Ranking history

ai-tool-set npm ranking history: currently #2143 (by weekly downloads).ai-tool-setnpm ranking · by weekly downloads · Last 90 days#2143current rank#1500#1600#1700#1800#1900#2000#2100#2200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 11, 2026 – Dec 6, 2026 · 26 observations · Updated Dec 5, 2026pluginstats.com
ai-tool-set npm ranking history: currently #2143 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 108, #3 (overall #2,143)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 13, #1 (overall #241)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (142)
Recent weekly downloads observations for ai-tool-set
Date (UTC)Weekly downloadsChange vs. previous
790+44
746-289
1,035-428
1,463-90
1,553-358
1,911+161
1,750-9
1,759-1
1,760+263
1,497+372
1,125-67
1,192+274
918+33
885—

Similar npm AI SDKs plugins

All 20 ai-tool-set alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/ai-tool-set. First seen Nov 11, 2026; last successful collection Dec 6, 2026. See the methodology.