[Upstream sync] mims-harvard/ToolUniverse (github) — 2 added, 1 modified #14

Merged
promptadmin merged 3 commits from upstream-sync/tooluniverse-20260701-bb632a-dufw into main 2026-07-02 19:22:38 +00:00
3 changed files with 119 additions and 3 deletions
@@ -2,9 +2,9 @@
title: "ToolUniverse Skills"
task: ""
lineage_type: import
upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/e2520a96/skills/README.md
upstream_sha: e2520a96
imported_at: 2026-06-26
upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/bb632a34/skills/README.md
upstream_sha: bb632a34
imported_at: 2026-07-01
prompt_class: catalogue
upstream_changes: accepted
author: upstream
@@ -98,6 +98,7 @@ npx skills add mims-harvard/ToolUniverse
| Skill | Description |
|-------|-------------|
| `setup-tooluniverse` | Install and configure ToolUniverse (MCP, CLI, or SDK) |
| `tooluniverse-cs-setup` | Install/update ToolUniverse in **Claude Science** (conda env + pip package + native skill; not MCP) |
| `create-tooluniverse-skill` | Create new skills with test-driven methodology |
| `devtu-auto-discover-apis` | Discover life science APIs and create tools automatically |
| `devtu-create-tool` | Create new scientific tools with proper structure and testing |
@@ -0,0 +1,68 @@
---
lineage_type: import
upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/bb632a34/skills/tooluniverse-cs-setup/SKILL.md
upstream_sha: bb632a34
imported_at: 2026-07-01
prompt_class: unknown
upstream_changes: accepted
name: tooluniverse-cs-setup
description: Install or update ToolUniverse in Claude Science — create the conda env, install the tooluniverse pip package, and (re)build the tooluniverse-research skill by fetching the current workflow library from GitHub. Use for first-time setup, upgrading the ToolUniverse version, refreshing the bundled workflows after an upstream release, or reinstalling on a new machine.
---
# Set up ToolUniverse for Claude Science
The upstream ToolUniverse ships a Claude **Code** plugin (MCP server + `uvx` + slash commands). Claude **Science** loads capabilities differently, so this skill installs the equivalent natively: the `tooluniverse` **pip package** supplies the 2500+ tools, and the workflow library is packaged into a single dynamically-loaded skill, `tooluniverse-research`. No `uv`, no MCP server, no plugin marketplace.
Loading this skill defines `tu_build_research_bundle()` in the kernel (run cells in the **`tooluniverse`** conda env).
## Full install / update — four steps
**1. Create the conda env** (skip if it already exists):
```
manage_environments(mode="create", name="tooluniverse", python_version="3.11", packages=["pip"])
```
**2. Install (or upgrade) the tools** — the pip package is the tool layer:
```
manage_packages(mode="install", environment="tooluniverse", packages=["tooluniverse"], use_pip=True)
```
Pin a version for reproducibility with `["tooluniverse==1.3.0"]`.
**3. Stage the workflow bundle** — fetch the current repo and rebuild the file tree (run in a `python` cell, env `tooluniverse`):
```python
res = tu_build_research_bundle(staging="./tu_staging")
res # {out_dir, n_workflows, n_files, dropped, files_head}
```
This downloads the repo tarball, parses every `tooluniverse-*` workflow (dropping the plugin/installer entries), and writes `./tu_staging/out/` = `SKILL.md`, `kernel.py`, `index.json`, `workflows/*.md`.
**4. Publish the skill** — push the staged tree into the catalog (run in the **`repl`** tool; `host.skills.*` lives there, not in `python`):
```python
import os
SKILL = "tooluniverse-research"
out = os.path.abspath("./tu_staging/out")
if any(s["name"] == SKILL for s in host.skills.list()):
host.skills.delete(SKILL) # clean rebuild
for root, _d, fs in os.walk(out):
for f in fs:
p = os.path.join(root, f)
rel = os.path.relpath(p, out)
host.skills.edit(SKILL, rel, open(p, encoding="utf-8").read())
print(host.skills.publish(SKILL, overwrite=True))
```
(`host.skills.publish` refuses if `kernel.py` fails the sidecar gate — the `edit` result carries the verdict.)
## Verify
```python
skill("tooluniverse-research") # loads router + injects helpers
tu = get_tu()
tu.run({"name": "PubChem_get_CID_by_compound_name", "arguments": {"name": "metformin"}})
# -> {'status': 'success', 'data': {'IdentifierList': {'CID': [4091]}}}
```
## Notes
- **Sandbox cache**: ToolUniverse defaults its cache to `~/.tooluniverse`, which is read-only here; `get_tu()` redirects it to the workspace via `TOOLUNIVERSE_CACHE_DIR`. Nothing to configure.
- **API keys** (optional): most tools work without them. For NCBI / OncoKB / NVIDIA etc., add keys under Customize → Credentials, then expose them in the `tooluniverse` env.
- **What is NOT ported**: the plugin's slash commands (`/tooluniverse:research`) and MCP server — replaced by natural-language routing (`search_skills``find_tu_workflow`). The two `*-plugin` installer docs are dropped as non-research entries.
- **Updating**: rerun steps 24. Step 2 upgrades the tools; steps 34 refresh the workflow library from the latest GitHub state.
@@ -0,0 +1,47 @@
---
lineage_type: import
upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/bb632a34/skills/tooluniverse-cs-setup/templates/router_SKILL.md
upstream_sha: bb632a34
imported_at: 2026-07-01
prompt_class: prompt
upstream_changes: accepted
name: tooluniverse-research
description: Biomedical and scientific research via ToolUniverse's 2500+ tools across 133 structured workflows — drug research, disease research, gene and variant interpretation, cancer genomics, clinical trials, ADMET prediction, pharmacovigilance and adverse events, CRISPR screens, protein and structure analysis, epidemiology, and graded literature reviews. Use for "tell me about drug/gene/disease/variant X", multi-database investigations, cross-validating biomedical claims, ID translation, or any structured scientific lookup spanning FDA, ChEMBL, PubChem, ClinicalTrials.gov, UniProt, Ensembl, PubMed, and 200+ other databases.
---
# ToolUniverse Research
Brings ToolUniverse's 2500+ scientific tools and 133 structured research workflows into Claude Science. The `tooluniverse` PyPI package supplies the tools; this skill bundles the workflows and a kernel sidecar that wires them up.
## Setup
Run all cells in the **`tooluniverse`** conda environment. Loading this skill auto-defines these helpers in the kernel:
- `get_tu()` → a loaded `ToolUniverse` instance (cache redirected to the workspace, since `~/.tooluniverse` is read-only here).
- `tu_workflows()` → list all 133 workflows (`name` + `description`).
- `find_tu_workflow(query)` → rank workflows by relevance to a question.
- `tu_workflow(name)` → the full step-by-step procedure for one workflow.
- `tu_tool_info(tu, name)` → a tool's JSON spec, including its argument schema.
## Answering a research question
1. **Route** to a workflow: `find_tu_workflow("tell me about metformin")` returns ranked names. (Or browse `tu_workflows()`.)
2. **Load** its procedure: `print(tu_workflow("tooluniverse-drug-research"))` and follow the steps.
3. **Execute** the tools the workflow names. Every `ToolName(args)` reference maps to:
```python
tu = get_tu()
tu.run({"name": "PubChem_get_CID_by_compound_name",
"arguments": {"name": "metformin"}})
```
4. **Confirm argument names** before a call if unsure — `tu_tool_info(tu, "PubChem_get_CID_by_compound_name")` shows the exact schema. Workflow prose abbreviates arguments; the schema is authoritative.
5. **Discover tools** at runtime when no workflow fits:
```python
tu.run({"name": "Tool_Finder_Keyword",
"arguments": {"description": "drug adverse events", "limit": 10}})
```
## Notes
- Most tools work without API keys. A few (NCBI, OncoKB, NVIDIA, …) unlock enhanced access when keys are set in the env — add under Customize → Credentials, then expose them in the `tooluniverse` env.
- Workflows are self-contained: report templates, checklists, and tool references are appended to each as appendices.
- These workflows emphasize *looking things up* over recalling them — when a workflow says query a database, run the tool rather than answering from memory.