Skip to content

tool-prune

JS and Python library that selects and prunes agent tools and MCP schemas, using offline vector search or Jev with calibrated probabilities.

MCP serverbetaMIT

Overview

tool-prune narrows a large set of agent tools to the ones relevant to a request before the LLM sees them. One call, prune(query, tools), returns the best tool; a reusable router can filter candidates based on the confidence drop-off or a fixed top-K, and dispatch can call a tool directly when confidence clears a threshold, falling back to an LLM otherwise.

It has two engines. TurboQuant runs fully offline with vector search and no dependencies. When TYPESAFE_API_KEY is set, it uses Jev through System One for calibrated choices. The README claims up to 92 percent fewer prompt tokens from schema pruning and direct dispatch in under 160 ms; these are the author's figures. It is aimed at developers whose agents carry dozens or hundreds of MCP tool schemas.

What the decision model decides

TypeQuestionAnswers
ChoiceWhich tool best fits this request?readFile · runQuery · webSearch · ...caller-supplied tools

How it works

  1. Register tools with short descriptions.
  2. Call prune or router.filter with the user prompt.
  3. TurboQuant or Jev scores the tools.
  4. Pass the pruned set to the LLM, or dispatch directly above a threshold with an LLM fallback.

Strengths

  • Smaller tool lists reduce prompt tokens; the README claims up to 92 percent.
  • Direct dispatch skips LLM generation when confident.
  • Works offline by default; Jev is optional.
  • Identical API in JavaScript and Python.

Caveats

  • Accuracy and token figures are the author's claims.
  • Jev engine needs a hosted key.

Getting started

npm install tool-prune  (or pip install tool-prune); optionally export TYPESAFE_API_KEY.

At a glance

Type
MCP server
Status
beta
Language
TypeScript, Python
Runtime
Node, Python library
Has code
yes
License
MIT

Use cases and integrations

How curated lists describe it

  • Calibrated tool selection and schema pruning for AI agents. Dual-engine: zero-dependency offline TurboQuant or TypeSafe System One (Jev). Prunes candidate MCP tools and schemas down to the relevant set before calling LLMs to eliminate hallucinations and save tokens.

    logicrw/awesome-jev-projects

Frequently asked questions

What does tool-prune decide?

Which of the registered tools fits a request, and which subset to pass to the LLM.

Does it need a TypeSafe key?

No; the TurboQuant engine works offline, and Jev is used only when a key is set.

Can it skip the LLM?

Yes, dispatch calls the tool directly when confidence clears your threshold.

Related projects

  • Pi extension that removes the skill catalogue from the system prompt and adds a skill_search tool where Jev rates each skill 0-2.

    Agent skillbetaTypeScript
  • MIT plugin and local MCP server that hands an agent's closed questions to Jev or local Laya, with policy gates and receipts.

    Agent skillproductionPython
  • Claude Code and Codex skill that routes a task to one of 27 specialist roles, with an optional Jev engine for catalog selection.

    ProjectbetaPython
  • Claude Code hook that decides which agent or skill should handle a request using YAML rulebooks plus one Jev Choice with confidence bands.

    HookbetaPython
  • Orchestrator that probes which coding agents are installed and logged in, then has Jev pick the best one for a task.

    Agent skillbetaPython
  • Hooks for Claude Code, Codex and pi that use Jev to suggest a skill each turn, plus a rule gate for subagent model routing.

    HookbetaJavaScript