Skip to content

Getting Started

Rakesh Singh edited this page Oct 23, 2026 · 1 revision

Getting Started

Install

pip install toolism                 # CLI + Python API
pip install "toolism[verify]"       # + equivalence verification
pip install "toolism[mcp]"          # + read tools straight from an MCP server
pip install "toolism[all]"          # everything, incl. Anthropic's exact token counter

Python 3.10 or newer.

1. Measure

$ toolism measure tools.json

OpenAI (Chat and Responses), Anthropic and MCP tool JSON are detected automatically. To read the tools from a live MCP server instead of a file:

$ toolism measure --mcp "npx -y @modelcontextprotocol/server-github"

--mcp runs that command exactly as your shell would, so only point it at servers you would run anyway.

2. Slim

$ toolism slim tools.json -o tools.slim.json

The slimmed JSON keeps the input's format and envelope. The report (savings per rule and per tool) goes to stderr. Add --verify (needs toolism[verify]) to check every changed schema.

3. Gate it in CI

$ toolism check tools.json -b .toolism/baseline.json --update-baseline   # once, then commit it
$ toolism check tools.json -b .toolism/baseline.json --max-increase 5%   # in CI

See CI Integration for the GitHub Action and the pre-commit hook.

Offline or behind a proxy

The default tokenizer (tiktoken:o200k_base) downloads its vocabulary once on first use. Without network access, use -t heuristic, or download it once and set TIKTOKEN_CACHE_DIR.

Clone this wiki locally