Measure the hidden token bill of MCP and agent tool catalogs.
Project description
tool-tax
See how many tokens your agent tools burn before the user even asks a question.
tool-tax scans MCP-style tool catalogs, JSON/YAML tool manifests, and OpenAPI
files. It shows the full schema cost, ranks the heaviest tools, diffs catalog
changes in pull requests, and writes a slim tool index for progressive loading.
pipx install git+https://github.com/SihyeonJeon/tool-tax.git@v0.2.0
tool-tax scan examples
tool-tax diff old-tools.json new-tools.json
tool-tax pack examples --out .tool-tax
Example result:
Tools: 7
Full tool tax: 1,144 est. tokens
Slim index: 309 est. tokens
Potential savings: 835 est. tokens (73.0%)
Why
Agents keep getting more tools. MCP servers, browser tools, GitHub tools, database tools, and internal APIs all ship long schemas. If every schema is loaded up front, your agent pays a context tax before it starts working.
tool-tax gives that tax a number.
What It Does
- Finds tool definitions in JSON, YAML, and OpenAPI files.
- Estimates token cost for each tool schema.
- Ranks the most expensive tools.
- Diffs base/head catalogs for PR budget checks.
- Generates a slim
tool-index.jsonplus separate schema files. - Fails CI when the tool catalog grows past a budget.
- Posts or updates a GitHub PR report comment when configured.
Install
From GitHub:
pipx install git+https://github.com/SihyeonJeon/tool-tax.git@v0.2.0
From a clone:
git clone https://github.com/SihyeonJeon/tool-tax.git
cd tool-tax
python3 -m pip install -e .
Installs one runtime dependency: PyYAML.
Use
Scan a repo:
tool-tax scan .
Write Markdown and JSON reports:
tool-tax scan examples --format md --out tool-tax-report.md
tool-tax scan examples --format json --out tool-tax-report.json
Create a progressive-loading pack:
tool-tax pack examples --out .tool-tax
That writes:
.tool-tax/
tool-index.json # small always-load index
schemas/*.json # full schemas loaded only when needed
Fail CI on tool bloat:
tool-tax scan mcp-tools.json --max-tokens 12000 --max-tool-tokens 750
Compare a pull request:
tool-tax diff base-tools.json head-tools.json --max-delta-tokens 500
Use it as a GitHub Action:
- uses: SihyeonJeon/tool-tax@v0.2.0
with:
path: .
max-tokens: "12000"
max-tool-tokens: "750"
Output
# Tool Tax Report
Grade: **lean**
| Metric | Value |
| --- | ---: |
| Tools | 7 |
| Full tool tax | 1,144 est. tokens |
| Slim index | 309 est. tokens |
| Potential savings | 835 est. tokens (73.0%) |
| Worst tool | 255 est. tokens |
Supports
- MCP-style JSON/YAML tool arrays
- Agent tool manifests with
name,description, andinputSchema - OpenAPI
pathsoperations - Nested JSON catalogs
- GitHub Step Summary and PR comment reports
Repo Shape
src/tool_tax/ # library + CLI
tests/ # unittest smoke coverage
examples/ # sample MCP/OpenAPI catalogs and reports
docs/ # trend scan and repo structure notes
Claim
This tool does not compress prompts by itself. It measures the up-front schema tax and creates a smaller index so your agent can load full schemas later.
It is the measuring tape and CI gate, not a runtime MCP proxy. Use it before or alongside proxy/search tools such as MCP compressors, CLI adapters, and progressive-disclosure gateways.
More
- Roadmap
- Public scan gallery
- PyPI publish notes
- Star forecast and comparison set
- Launch kit
- Trend scan
- Repo shape scan
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tool_tax-0.2.0.tar.gz.
File metadata
- Download URL: tool_tax-0.2.0.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b2033c27e6917eb1450274af5cfa64ce08de4afe3a36232cc6a915c61a5aba1
|
|
| MD5 |
5d1a6a204105a5caea167d7586d0b3a5
|
|
| BLAKE2b-256 |
3b8cab3da551dc3d9f3b3fddcf0f7c72772a91a0f91d0367fe39037beb1ad3bd
|
Provenance
The following attestation bundles were made for tool_tax-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on SihyeonJeon/tool-tax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tool_tax-0.2.0.tar.gz -
Subject digest:
2b2033c27e6917eb1450274af5cfa64ce08de4afe3a36232cc6a915c61a5aba1 - Sigstore transparency entry: 1572329308
- Sigstore integration time:
-
Permalink:
SihyeonJeon/tool-tax@21fc82371d731c155ff648e2ccc4f122ca9a7af3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SihyeonJeon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@21fc82371d731c155ff648e2ccc4f122ca9a7af3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file tool_tax-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tool_tax-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b8908ea5c744f8caf445a3c409ecc1780f9722887e3686dd4fab724dbb7cf2
|
|
| MD5 |
1998e86b797be16db26808dcd829631b
|
|
| BLAKE2b-256 |
6d440cec6493c603c1977d5092a66441518e7620792058bc150068e63c81a983
|
Provenance
The following attestation bundles were made for tool_tax-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on SihyeonJeon/tool-tax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tool_tax-0.2.0-py3-none-any.whl -
Subject digest:
55b8908ea5c744f8caf445a3c409ecc1780f9722887e3686dd4fab724dbb7cf2 - Sigstore transparency entry: 1572329322
- Sigstore integration time:
-
Permalink:
SihyeonJeon/tool-tax@21fc82371d731c155ff648e2ccc4f122ca9a7af3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SihyeonJeon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@21fc82371d731c155ff648e2ccc4f122ca9a7af3 -
Trigger Event:
workflow_dispatch
-
Statement type: