Official Repo for ToolGrad: Efficient Tool-use Dataset Generation with Textual “Gradients”
Project description
ToolGrad: Efficient Tool-use Dataset Generation with Textual "Gradients" (ACL 26 Finding)
[!WARNING] Notes: The current repo contains out-of-dated code. We will actively update the repo to align with our paper on ACL 2026. The following is a roadmap.
- [ ] Update data generation pipeline
- [ ] Update toolgrad package
- [ ] post-training code
- [ ] evaluate code
This is an official repo for <ToolGrad: Efficient Tool-use Dataset Generation with Textual “Gradients”>.
Get Started: A Quick Demo
Step 0: Install packages
Install nvm for MCP service:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
nvm install 20
nvm alias default 20
# verify npx
npx --version
Clone this repo and setup the uv env:
cd toolgrad
uv venv
uv sync
source .venv/bin/activate
Step 1: launch your first ToolGrad framework on a MCP service
# If you have no Gemini API key in your environment,
export GEMINI_API_KEY=YOUR_GEMINI_KEY
export PYTHONPATH=./
python examples/mcp_filesystem.py
During the execution, you should be able to see some useful logs to better understand the ToolGrad framework.
For example, the following is an example log of the API proposer.
INFO:root:[Iteration 2] Proposed 3 API proposals
INFO:root: Proposal 1 (proposal_1): Read the content of the 'favorite_books.txt' file.
INFO:root: └─ read_text_file
INFO:root: Proposal 2 (proposal_2): Read the contents of 'favorite_books.txt', 'favorite_cities.txt', and 'favorite_songs.txt' simultaneously.
INFO:root: └─ read_multiple_files
INFO:root: Proposal 3 (proposal_3): List the contents of the current directory.
INFO:root: └─ list_directory
The following is an example log of API executor.
INFO:root:[Iteration 2] Executed 3 proposals: 3 successful, 0 failed
INFO:root: ✓ proposal_1: 1 tool call(s)
INFO:root: Tool: read_text_file
INFO:root: Input: {'path': 'favorite_books.txt'}
INFO:root: ✓ proposal_2: 1 tool call(s)
INFO:root: Tool: read_multiple_files
INFO:root: Input: {'paths': ['favorite_books.txt', 'favorite_cities.txt', 'favorite_songs.txt']}
INFO:root: ✓ proposal_3: 1 tool call(s)
INFO:root: Tool: list_directory
INFO:root: Input: {'path': '.'}
After the execution, you should be able to see the output data in examples/outputs/. It should look similar to examples/outputs/trace_example/00123.json and examples/outputs/example_seed=123__iter=3__num_apis=5.json.
ToolGrad-500
This is a TODO.
BibTex
@misc{zhou2025toolgradefficienttoolusedataset,
title={ToolGrad: Efficient Tool-use Dataset Generation with Textual "Gradients"},
author={Zhongyi Zhou and Kohei Uehara and Haoyu Zhang and Jingtao Zhou and Lin Gu and Ruofei Du and Zheng Xu and Tatsuya Harada},
year={2025},
eprint={2508.04086},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2508.04086},
}
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 toolgrad-0.2.0.tar.gz.
File metadata
- Download URL: toolgrad-0.2.0.tar.gz
- Upload date:
- Size: 851.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
113d888f073a8a5dad04d472f85435b25d8faf0da0cdfcedff1d2dce54feaee6
|
|
| MD5 |
e9912fe745e031d6c098597619a61167
|
|
| BLAKE2b-256 |
9e6bf4334755f79888a4e2d11689f6bda2d2ac27c46838896a1939a967de3c32
|
Provenance
The following attestation bundles were made for toolgrad-0.2.0.tar.gz:
Publisher:
publish.yml on zhongyi-zhou/toolgrad
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolgrad-0.2.0.tar.gz -
Subject digest:
113d888f073a8a5dad04d472f85435b25d8faf0da0cdfcedff1d2dce54feaee6 - Sigstore transparency entry: 1573063537
- Sigstore integration time:
-
Permalink:
zhongyi-zhou/toolgrad@c944a90bb9b223e6fdf26491f218ed88c15d707f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/zhongyi-zhou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c944a90bb9b223e6fdf26491f218ed88c15d707f -
Trigger Event:
release
-
Statement type:
File details
Details for the file toolgrad-0.2.0-py3-none-any.whl.
File metadata
- Download URL: toolgrad-0.2.0-py3-none-any.whl
- Upload date:
- Size: 874.4 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 |
36dd7b35edc67c14021a5695a04f07fba61a9e0e702ef0c3468d9cd7bb8a7409
|
|
| MD5 |
1d1f11d4863e37eceaffa6786565df69
|
|
| BLAKE2b-256 |
533a0bda41ba78117ea811ec1a3f9c502e09723253668c4260527444d6fdf511
|
Provenance
The following attestation bundles were made for toolgrad-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on zhongyi-zhou/toolgrad
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolgrad-0.2.0-py3-none-any.whl -
Subject digest:
36dd7b35edc67c14021a5695a04f07fba61a9e0e702ef0c3468d9cd7bb8a7409 - Sigstore transparency entry: 1573063545
- Sigstore integration time:
-
Permalink:
zhongyi-zhou/toolgrad@c944a90bb9b223e6fdf26491f218ed88c15d707f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/zhongyi-zhou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c944a90bb9b223e6fdf26491f218ed88c15d707f -
Trigger Event:
release
-
Statement type: