Files
Shanghua Gao 4ae46d0b83 fix: tool discoverability, ChEMBL/Orphanet/EuropePMC bug fixes (#125)
* feat: improve tool descriptions for better discoverability

- search_clinical_trials: rewrite description to lead with disease/drug
  search use cases and example queries, making it clearly discoverable
  for natural language searches like "find clinical trials for a drug"
- gwas_search_associations: rewrite description to emphasize keyword
  search capability with example traits, distinguishing from ID-lookup tools
- gwas_get_variants_for_trait: expand description with disease examples
  and clarify this finds all variants for a trait
- Add 14 tests validating description quality and search/ID tool distinction

* feat: improve GWAS SNP tool descriptions for discoverability

- gwas_search_snps: expand description with rs ID and gene name examples
- gwas_get_snps_for_gene: add gene name examples and clarify use case

* fix: ChEMBL drug search redirect and Orphanet gene lookup subtype fallback

- ChEMBL: pref_name__contains now triggers /drug.json → /molecule.json
  redirect (previously only query/q params did)
- Orphanet: _get_genes() now tries direct orphacode lookup first, then
  searches subtypes by disease name when parent code lacks gene entries
  (e.g., Marfan syndrome 558 → finds FBN1 via subtype 284963)
- Added tests for both fixes

* fix: Orphanet search flooding, EuropePMC HTML abstracts, PubChem discoverability

- Orphanet search_diseases: add limit param (default 20) to prevent 3400+
  result flooding; return count/total_count metadata
- EuropePMC: strip HTML tags from abstractText field
- PubChem: improve PubChem_get_CID_by_compound_name description for
  better search discoverability
- Added tests for all fixes

* refactor: extract helpers in Orphanet _get_genes for clarity

Extract _fetch_genes_for_code() and _find_subtype_codes() to reduce
nesting and eliminate duplication in the gene lookup strategies.

* fix: GTEx gene symbol auto-resolution and ClinVar condition quoting

- GTEx: add gene_symbol parameter that auto-resolves to versioned GENCODE
  ID via /reference/gene API (e.g., FBN1 -> ENSG00000166147.13)
- GTEx: unversioned Ensembl IDs also auto-resolved to versioned form
- ClinVar: quote multi-word conditions for phrase matching
- Integration test: increase timeout to 180s for compose workflow

* refactor: reorder GTEx helpers for readability (define before use)

* fix: version bump to 1.1.2 and correct CLI docs

- Bump version to 1.1.2 in pyproject.toml and server.json
- Fix tu_cli.rst: trim verbose examples, fix --detail flag, remove
  inaccurate "all commands" claim for output flags
- Fix cli_tools.rst: correct --field choices, default host/port/workers,
  remove non-existent doctor flags, fix alias descriptions
- Fix toolspace.rst: tu serve does not accept --load/--global/--workspace
- Fix skill docs: tu find is keyword scoring not AI-powered, add missing
  custom mode, tu serve --load → tooluniverse --load
2026-03-06 11:26:08 -05:00

121 lines
2.6 KiB
ReStructuredText

tu — ToolUniverse CLI
=====================
``tu`` is the command-line interface for ToolUniverse. It mirrors the compact-mode MCP tools so you can discover and call tools directly from your shell.
.. code-block:: bash
tu <command> [options]
Output is human-readable by default. Add ``--json`` for pretty JSON or ``--raw`` for compact JSON (pipe-friendly).
---
Commands
--------
list
~~~~
List available tools. Default view shows category counts; add ``--categories`` to list tools within a category.
.. code-block:: bash
tu list # category overview
tu list --categories uniprot # tools in a category
tu list --mode basic --limit 20 # names + descriptions
tu list --mode custom --fields name type category
Modes: ``names``, ``categories`` (default), ``basic``, ``by_category``, ``summary``, ``custom``
grep
~~~~
Search tools by text or regex.
.. code-block:: bash
tu grep protein # substring search in names
tu grep protein --field description
tu grep '^UniProt' --mode regex
Fields: ``name`` (default), ``description``, ``type``, ``category``
find
~~~~
Find tools by natural-language query (keyword scoring, no API key needed).
.. code-block:: bash
tu find 'protein structure analysis'
tu find 'search for drug targets' --limit 5
tu find 'gene expression' --categories GTEx ENCODE
info
~~~~
Show the schema for one or more tools.
.. code-block:: bash
tu info UniProt_get_entry_by_accession
tu info UniProt_get_entry_by_accession --detail brief
tu info UniProt_get_entry_by_accession ChEMBL_get_molecule
run
~~~
Execute a tool. Arguments can be ``key=value`` pairs or a JSON string.
.. code-block:: bash
tu run UniProt_get_entry_by_accession accession=P12345
tu run list_tools '{"mode": "categories"}'
test
~~~~
Test a tool with example inputs and report pass/fail.
.. code-block:: bash
tu test Dryad_search_datasets # use built-in example inputs
tu test MyAPI_search '{"q": "test"}' # custom input
status
~~~~~~
Show how many tools are loaded and the top categories.
.. code-block:: bash
tu status
build
~~~~~
Regenerate the static tool registry and coding-API wrapper files. Output defaults to ``.tooluniverse/coding_api/``; use ``--output`` to override.
.. code-block:: bash
tu build
tu build --output ./my_tools
serve
~~~~~
Start the MCP stdio server (equivalent to running ``tooluniverse``).
.. code-block:: bash
tu serve
---
See Also
--------
- :doc:`toolspace` — configure which tools load via ``profile.yaml``
- :doc:`building_ai_scientists/compact_mode` — compact mode in MCP