tooluniverse 软件包

class tooluniverse.ToolUniverse[源代码]

基类:object

一个用于加载、组织和执行各种科学及数据工具的综合工具管理系统。

ToolUniverse 类提供了一个集中式接口,用于管理包括 GraphQL 工具、RESTful API、MCP 客户端及专业科学工具在内的多种工具类型。它负责工具的加载、筛选、缓存及执行。

all_tools

所有已加载工具配置列表

类型:

列表

all_tool_dict

将工具名称映射到其配置的字典

类型:

dict

tool_category_dicts

按类别组织的工具字典

类型:

dict

tool_files

将类别名称映射到其对应的 JSON 文件路径的字典

类型:

dict

callable_functions

已实例化工具对象的缓存

类型:

dict

MAX_TOOL_NAME_LENGTH = 45
__init__(tool_files={'ChEMBL': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/chembl_tools.json', 'EFO': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/efo_tools.json', 'Enrichr': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/enrichr_tools.json', 'EuropePMC': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/europe_pmc_tools.json', 'HumanBase': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/humanbase_tools.json', 'OpenAlex': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openalex_tools.json', 'ada_aha_nccn': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ada_aha_nccn_tools.json', 'addgene': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/addgene_tools.json', 'admetai': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/admetai_tools.json', 'adverse_event': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/adverse_event_tools.json', 'agents': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/agentic_tools.json', 'aging_cohort': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/aging_cohort_tools.json', 'allen_brain': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/allen_brain_tools.json', 'alliance_genome': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/alliance_genome_tools.json', 'alphafold': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/alphafold_tools.json', 'alphamissense': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/alphamissense_tools.json', 'anaconda': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/anaconda_tools.json', 'aopwiki': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/aopwiki_tools.json', 'appris': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/appris_tools.json', 'archs4': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/archs4_tools.json', 'arrayexpress': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/arrayexpress_tools.json', 'artic': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/artic_tools.json', 'arxiv': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/arxiv_tools.json', 'bgee': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bgee_tools.json', 'bigg_models': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bigg_models_tools.json', 'bindingdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bindingdb_tools.json', 'bioconductor': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bioconductor_tools.json', 'biogrid': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/biogrid_tools.json', 'bioimage_archive': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bioimage_archive_tools.json', 'biomodels_tools': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/biomodels_tools.json', 'bioportal': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bioportal_tools.json', 'bioregistry': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bioregistry_tools.json', 'biorxiv': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/biorxiv_tools.json', 'biorxiv_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/biorxiv_ext_tools.json', 'biosamples': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/biosamples_tools.json', 'biostudies': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/biostudies_tools.json', 'biothings': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/biothings_tools.json', 'biotools_registry': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/biotools_registry_tools.json', 'blast': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/blast_tools.json', 'bmrb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bmrb_tools.json', 'brenda': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/brenda_tools.json', 'bridgedb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bridgedb_tools.json', 'bvbrc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/bvbrc_tools.json', 'cadd': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cadd_tools.json', 'cancer_prognosis': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cancer_prognosis_tools.json', 'cancervar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cancervar_tools.json', 'cath': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cath_tools.json', 'cbioportal': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cbioportal_tools.json', 'cdc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cdc_tools.json', 'ceda': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ceda_tools.json', 'cellmarker': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cellmarker_tools.json', 'cellosaurus': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cellosaurus_tools.json', 'cellpainting': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cellpainting_tools.json', 'cellxgene_census': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cellxgene_census_tools.json', 'cellxgene_discovery': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cellxgene_discovery_tools.json', 'channelsdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/channelsdb_tools.json', 'chebi': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/chebi_tools.json', 'chem_compute': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/chem_compute_tools.json', 'chipatlas': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/chipatlas_tools.json', 'civic': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/civic_tools.json', 'clingen': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/clingen_tools.json', 'clingen_allele': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/clingen_allele_tools.json', 'clingen_ar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/clingen_ar_tools.json', 'clingen_dosage': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/clingen_dosage_api_tools.json', 'clinical_guidelines': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/clinical_guidelines_tools.json', 'clinical_trials': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/clinicaltrials_gov_tools.json', 'clinvar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/clinvar_tools.json', 'clue': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/clue_tools.json', 'cod_crystal': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cod_crystal_tools.json', 'col': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/col_tools.json', 'compact_mode': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/compact_mode_tools.json', 'complex_portal': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/complex_portal_tools.json', 'compose': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/compose_tools.json', 'core': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/core_tools.json', 'cosmic': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cosmic_tools.json', 'cpic': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cpic_tools.json', 'cran': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cran_tools.json', 'crossref': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/crossref_tools.json', 'cryoet': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/cryoet_tools.json', 'crystal_structure': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/crystal_structure_tools.json', 'ctd': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ctd_tools.json', 'dailymed': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dailymed_tools.json', 'data_quality': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/data_quality_tools.json', 'datacite': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/datacite_tools.json', 'datagov': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/datagov_tools.json', 'dataone': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dataone_tools.json', 'dataset': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dataset_tools.json', 'dataverse': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dataverse_tools.json', 'dbfetch': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dbfetch_tools.json', 'dblp': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dblp_tools.json', 'dbpedia': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dbpedia_tools.json', 'dbsnp': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dbsnp_tools.json', 'deepgo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/deepgo_tools.json', 'degrees_of_unsaturation': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/degrees_of_unsaturation_tools.json', 'depmap': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/depmap_tools.json', 'dfam': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dfam_tools.json', 'dgidb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dgidb_tools.json', 'disease_ontology': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/disease_ontology_tools.json', 'disease_sh_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/disease_sh_ext_tools.json', 'disease_target_score': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/disease_target_score_tools.json', 'diseasesh': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/diseasesh_tools.json', 'disgenet': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/disgenet_tools.json', 'disprot': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/disprot_tools.json', 'dna_tools': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dna_tools.json', 'doaj': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/doaj_tools.json', 'dose_response': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dose_response_tools.json', 'drug_discovery_agents': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/drug_discovery_agents.json', 'drug_properties': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/drug_properties_tools.json', 'drug_synergy': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/drug_synergy_tools.json', 'drugcentral': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/drugcentral_tools.json', 'dryad': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dryad_tools.json', 'dynamut2': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/dynamut2_tools.json', 'ebi_proteins_coordinates': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ebi_proteins_coordinates_tools.json', 'ebi_proteins_epitope': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ebi_proteins_epitope_tools.json', 'ebi_proteins_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ebi_proteins_ext_tools.json', 'ebi_proteins_features': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ebi_proteins_features_tools.json', 'ebi_proteins_interactions': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ebi_proteins_interactions_tools.json', 'ebi_search': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ebi_search_tools.json', 'ebi_taxonomy': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ebi_taxonomy_tools.json', 'ebird_taxonomy': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ebird_taxonomy_tools.json', 'elixir_tess': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/elixir_tess_tools.json', 'elm': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/elm_tools.json', 'embedding': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/embedding_tools.json', 'emdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/emdb_tools.json', 'emolecules': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/emolecules_tools.json', 'empiar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/empiar_tools.json', 'ena_browser': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ena_browser_tools.json', 'ena_portal': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ena_portal_tools.json', 'enamine': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/enamine_tools.json', 'encode': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/encode_tools.json', 'enrichr_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/enrichr_ext_tools.json', 'ensembl': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_tools.json', 'ensembl_archive': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_archive_tools.json', 'ensembl_compara': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_compara_tools.json', 'ensembl_info': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_info_tools.json', 'ensembl_ld': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_ld_tools.json', 'ensembl_map': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_map_tools.json', 'ensembl_overlap': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_overlap_tools.json', 'ensembl_phenotype': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_phenotype_tools.json', 'ensembl_regulation': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_regulation_tools.json', 'ensembl_sequence': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_sequence_tools.json', 'ensembl_variation_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_variation_ext_tools.json', 'ensembl_vep': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_vep_tools.json', 'ensembl_xrefs': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ensembl_xrefs_tools.json', 'eol': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/eol_tools.json', 'epidemiology': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/epidemiology_tools.json', 'epigenomics': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/epigenomics_tools.json', 'epigraphdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/epigraphdb_tools.json', 'epmc_annotations': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/epmc_annotations_tools.json', 'eqtl': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/eqtl_tools.json', 'erddap': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/erddap_tools.json', 'esm': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/esm_tools.json', 'esmfold': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/esmfold_tools.json', 'euhealth': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/euhealth_tools.json', 'europepmc_annotations': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/europepmc_annotations_tools.json', 'europepmc_citations': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/europepmc_citations_tools.json', 'eurostat': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/eurostat_tools.json', 'eva': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/eva_tools.json', 'eve': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/eve_tools.json', 'expression_atlas': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/expression_atlas_tools.json', 'faers_analytics': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/faers_analytics_tools.json', 'fatcat': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fatcat_tools.json', 'fda_drug_adverse_event': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fda_drug_adverse_event_tools.json', 'fda_drug_adverse_event_detail': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fda_drug_adverse_event_detail_tools.json', 'fda_drug_label': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fda_drug_labeling_tools.json', 'fda_gsrs': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fda_gsrs_tools.json', 'fda_orange_book': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fda_orange_book_tools.json', 'fda_pharmacogenomic_biomarkers': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fda_pharmacogenomic_biomarkers_tools.json', 'figshare': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/figshare_tools.json', 'file_download': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/file_download_tools.json', 'finngen': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/finngen_tools.json', 'flybase': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/flybase_tools.json', 'flymine': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/flymine_tools.json', 'foldseek': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/foldseek_tools.json', 'fooddata_central': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fooddata_central_tools.json', 'fourdn': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fourdn_tools.json', 'fpbase': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/fpbase_tools.json', 'gbif': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gbif_tools.json', 'gbif_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gbif_ext_tools.json', 'gdc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gdc_tools.json', 'gencc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gencc_tools.json', 'gene2phenotype': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gene2phenotype_tools.json', 'genenetwork': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/genenetwork_tools.json', 'genenetwork_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/genenetwork_ext_tools.json', 'genome_nexus': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/genome_nexus_tools.json', 'geo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/geo_tools.json', 'github': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/github_tools.json', 'glygen': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/glygen_tools.json', 'gmrepo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gmrepo_tools.json', 'gnomad': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gnomad_tools.json', 'gnps': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gnps_tools.json', 'go': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gene_ontology_tools.json', 'go_api': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/go_api_tools.json', 'gpcrdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gpcrdb_tools.json', 'gprofiler': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gprofiler_tools.json', 'gtdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gtdb_tools.json', 'gtex': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gtex_tools.json', 'gtex_v2': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gtex_v2_tools.json', 'gtopdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gtopdb_tools.json', 'guidelines': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/unified_guideline_tools.json', 'gwas': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gwas_tools.json', 'gwas_sumstats': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gwas_sumstats_tools.json', 'gxa': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/gxa_tools.json', 'hal': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/hal_tools.json', 'harmonizome': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/harmonizome_tools.json', 'hca_tools': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/hca_tools.json', 'health_disparities': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/health_disparities_tools.json', 'hgnc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/hgnc_tools.json', 'hocomoco': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/hocomoco_tools.json', 'hpa': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/hpa_tools.json', 'hpo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/hpo_tools.json', 'hubmap': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/hubmap_tools.json', 'huggingface': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/huggingface_tools.json', 'humanmine': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/humanmine_tools.json', 'icd': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/icd_tools.json', 'icite': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/icite_tools.json', 'identifiers_org': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/identifiers_org_tools.json', 'idigbio': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/idigbio_tools.json', 'idmap': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/idmap_tools.json', 'idr': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/idr_tools.json', 'idt': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/idt_tools.json', 'iedb_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/iedb_ext_tools.json', 'iedb_prediction': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/iedb_prediction_tools.json', 'iedb_tools': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/iedb_tools.json', 'igsr': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/igsr_tools.json', 'imgt': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/imgt_tools.json', 'immport': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/immport_tools.json', 'impc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/impc_tools.json', 'inaturalist': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/inaturalist_tools.json', 'indra': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/indra_tools.json', 'inspirehep': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/inspirehep_tools.json', 'intact': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/intact_tools.json', 'interpro': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/interpro_tools.json', 'interpro_domain_arch': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/interpro_domain_arch_tools.json', 'interpro_entry': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/interpro_entry_tools.json', 'interpro_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/interpro_ext_tools.json', 'interproscan': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/interproscan_tools.json', 'intervar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/intervar_tools.json', 'intogen': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/intogen_tools.json', 'iptmnet': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/iptmnet_tools.json', 'itis': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/itis_tools.json', 'jaspar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/jaspar_tools.json', 'jpl_horizons': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/jpl_horizons_tools.json', 'kegg': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/kegg_tools.json', 'kegg_brite': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/kegg_brite_tools.json', 'kegg_conv_link': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/kegg_conv_link_tools.json', 'kegg_disease_drug': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/kegg_disease_drug_tools.json', 'kegg_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/kegg_ext_tools.json', 'kegg_network_variant': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/kegg_network_variant_tools.json', 'klifs': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/klifs_tools.json', 'l1000fwd': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/l1000fwd_tools.json', 'lincs': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/lincs_tools.json', 'lipidmaps': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/lipidmaps_tools.json', 'literature_search': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/literature_search_tools.json', 'litvar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/litvar_tools.json', 'lncrna': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/lncrna_tools.json', 'loinc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/loinc_tools.json', 'lotus': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/lotus_tools.json', 'lovd': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/lovd_tools.json', 'marine_regions': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/marine_regions_tools.json', 'markitdown': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/markitdown_tools.json', 'massbank': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/massbank_tools.json', 'massive': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/massive_tools.json', 'mavedb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mavedb_tools.json', 'mcp_auto_loader_boltz': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/boltz_mcp_loader_tools.json', 'mcp_auto_loader_esm': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mcp_auto_loader_esm.json', 'mcp_auto_loader_expert_feedback': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/expert_feedback_tools.json', 'mcp_auto_loader_txagent': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/txagent_client_tools.json', 'mcp_auto_loader_uspto_downloader': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uspto_downloader_tools.json', 'mcule': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mcule_tools.json', 'medgen': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/medgen_tools.json', 'medlineplus': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/medlineplus_tools.json', 'medrxiv': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/medrxiv_tools.json', 'meme': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/meme_tools.json', 'mesh': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mesh_tools.json', 'meta_analysis': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/meta_analysis_tools.json', 'metaboanalyst': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/metaboanalyst_tools.json', 'metabolights': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/metabolights_tools.json', 'metabolite': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/metabolite_tools.json', 'metabolomics_workbench': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/metabolomics_workbench_tools.json', 'metacyc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/metacyc_tools.json', 'metnorway': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/metnorway_tools.json', 'mgi': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mgi_tools.json', 'mgnify': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mgnify_tools.json', 'mgnify_expanded': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mgnify_expanded_tools.json', 'mibig': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mibig_tools.json', 'mirna': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mirna_tools.json', 'mobidb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mobidb_tools.json', 'modeldb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/modeldb_tools.json', 'modomics': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/modomics_tools.json', 'monarch': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/monarch_tools.json', 'monarch_new': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/monarch_new_tools.json', 'monarch_v3': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/monarch_v3_tools.json', 'mondo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mondo_tools.json', 'mousemine': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mousemine_tools.json', 'mpd': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mpd_tools.json', 'msigdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/msigdb_tools.json', 'mutalyzer': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mutalyzer_tools.json', 'mydisease': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/mydisease_tools.json', 'nasa_cmr': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nasa_cmr_tools.json', 'nasa_donki': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nasa_donki_tools.json', 'nasa_eonet': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nasa_eonet_tools.json', 'nasa_exoplanet': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nasa_exoplanet_tools.json', 'nasa_ned': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nasa_ned_tools.json', 'nasa_neows': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nasa_neows_tools.json', 'nasa_sbdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nasa_sbdb_tools.json', 'nca': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nca_tools.json', 'ncbi_datasets': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ncbi_datasets_tools.json', 'ncbi_gene': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ncbi_gene_tools.json', 'ncbi_nucleotide': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ncbi_nucleotide_tools.json', 'ncbi_sra': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ncbi_sra_tools.json', 'ncbi_variation': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ncbi_variation_tools.json', 'nci_cactus': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nci_cactus_tools.json', 'nci_drugdict': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nci_drugdict_tools.json', 'nci_thesaurus': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nci_thesaurus_tools.json', 'ndex': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ndex_tools.json', 'neb_tm': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/neb_tm_tools.json', 'neuromorpho': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/neuromorpho_tools.json', 'neurovault': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/neurovault_tools.json', 'nextstrain': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nextstrain_tools.json', 'nhanes': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nhanes_tools.json', 'nominatim': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nominatim_tools.json', 'nvidia_nim': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nvidia_nim_tools.json', 'nws': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/nws_tools.json', 'obis': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/obis_tools.json', 'odphp': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/odphp_tools.json', 'ols': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ols_tools.json', 'oma': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/oma_tools.json', 'omicsdi': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/omicsdi_tools.json', 'omim': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/omim_tools.json', 'omnipath': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/omnipath_tools.json', 'oncokb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/oncokb_tools.json', 'oncotree': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/oncotree_tools.json', 'open_meteo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/open_meteo_tools.json', 'open_meteo_airquality': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/open_meteo_airquality_tools.json', 'open_meteo_climate': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/open_meteo_climate_tools.json', 'open_meteo_flood': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/open_meteo_flood_tools.json', 'open_meteo_marine': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/open_meteo_marine_tools.json', 'openaire': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openaire_tools.json', 'openaire_dataset': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openaire_dataset_tools.json', 'opencitations': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/opencitations_tools.json', 'opencravat': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/opencravat_tools.json', 'openfda': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openfda_tools.json', 'openfda_approvals': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openfda_approval_tools.json', 'openfda_labels': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openfda_label_tools.json', 'openfoodfacts': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openfoodfacts_tools.json', 'openml': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openml_tools.json', 'openneuro': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/openneuro_tools.json', 'opentarget': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/opentarget_tools.json', 'opentarget_genetics': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/opentarget_genetics_tools.json', 'opentopodata': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/opentopodata_tools.json', 'opentree': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/opentree_tools.json', 'optimizer': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/optimizer_tools.json', 'orcid': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/orcid_tools.json', 'orphanet': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/orphanet_tools.json', 'orthodb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/orthodb_tools.json', 'osdr': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/osdr_tools.json', 'osf_preprints': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/osf_preprints_tools.json', 'output_summarization': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/output_summarization_tools.json', 'oxo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/oxo_tools.json', 'package_discovery_tools': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/package_discovery_tools.json', 'paleobiology': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/paleobiology_tools.json', 'panelapp': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/panelapp_tools.json', 'panther': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/panther_tools.json', 'pathwaycommons': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pathwaycommons_tools.json', 'pdb_redo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdb_redo_tools.json', 'pdbe_api': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbe_api_tools.json', 'pdbe_compound': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbe_compound_tools.json', 'pdbe_graph': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbe_graph_tools.json', 'pdbe_kb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbe_kb_tools.json', 'pdbe_ligands': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbe_ligands_tools.json', 'pdbe_search': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbe_search_tools.json', 'pdbe_sifts': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbe_sifts_tools.json', 'pdbe_validation': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbe_validation_tools.json', 'pdbepisa': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdbepisa_tools.json', 'pdc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pdc_tools.json', 'pfam': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pfam_tools.json', 'pharmacodb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pharmacodb_tools.json', 'pharmgkb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pharmgkb_tools.json', 'pharmvar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pharmvar_tools.json', 'pharos': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pharos_tools.json', 'plant_reactome': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/plant_reactome_tools.json', 'pmc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pmc_tools.json', 'pombase': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pombase_tools.json', 'popgen': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/popgen_tools.json', 'powo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/powo_tools.json', 'ppi': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ppi_tools.json', 'pride': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pride_tools.json', 'progenetix': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/progenetix_tools.json', 'prosite': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/prosite_tools.json', 'protacdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/protacdb_tools.json', 'proteins_api': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/proteins_api_tools.json', 'proteinsplus': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/proteinsplus_tools.json', 'proteomexchange': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/proteomexchange_tools.json', 'proteomicsdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/proteomicsdb_tools.json', 'protparam': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/protparam_tools.json', 'protvar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/protvar_tools.json', 'pubchem': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pubchem_tools.json', 'pubchem_bioassay': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pubchem_bioassay_tools.json', 'pubchem_tox': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pubchem_tox_tools.json', 'pubmed': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pubmed_tools.json', 'pubtator': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pubtator_tools.json', 'pubtator3_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pubtator3_ext_tools.json', 'pypi_package_inspector_tools': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/pypi_package_inspector_tools.json', 'python_executor': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/python_executor_tools.json', 'quickgo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/quickgo_tools.json', 'rcsb_advanced_search': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rcsb_advanced_search_tools.json', 'rcsb_chemcomp': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rcsb_chemcomp_tools.json', 'rcsb_data': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rcsb_data_tools.json', 'rcsb_graphql': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rcsb_graphql_tools.json', 'rcsb_pdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rcsb_pdb_tools.json', 'rcsb_search': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rcsb_search_tools.json', 'rdkit_cheminfo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rdkit_cheminfo_tools.json', 're3data': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/re3data_tools.json', 'reactome': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/reactome_tools.json', 'reactome_analysis': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/reactome_analysis_tools.json', 'reactome_content': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/reactome_content_tools.json', 'reactome_interactors': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/reactome_interactors_tools.json', 'regulomedb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/regulomedb_tools.json', 'remap': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/remap_tools.json', 'rfam': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rfam_tools.json', 'rgd': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rgd_tools.json', 'rhea': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rhea_tools.json', 'rnacentral': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rnacentral_tools.json', 'ror': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ror_tools.json', 'rxclass': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rxclass_tools.json', 'rxnorm': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rxnorm_tools.json', 'rxnorm_extended': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/rxnorm_extended_tools.json', 'sabdab': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sabdab_tools.json', 'sabiork': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sabiork_tools.json', 'sasbdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sasbdb_tools.json', 'scanprosite': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/scanprosite_tools.json', 'scientific_calculator': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/scientific_calculator_tools.json', 'scite': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/scite_tools.json', 'screen': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/screen_tools.json', 'scxa': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/scxa_tools.json', 'sdss': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sdss_tools.json', 'semantic_scholar': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/semantic_scholar_tools.json', 'semantic_scholar_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/semantic_scholar_ext_tools.json', 'sequence_analyze': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sequence_analyze_tools.json', 'sgd': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sgd_tools.json', 'sider': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sider_tools.json', 'signor': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/signor_tools.json', 'simbad': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/simbad_tools.json', 'smiles_verify': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/smiles_verify_tools.json', 'smolagents': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/smolagent_tools.json', 'software_bioinformatics': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/bioinformatics_core_tools.json', 'software_cheminformatics': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/cheminformatics_tools.json', 'software_earth_sciences': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/earth_sciences_tools.json', 'software_genomics': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/genomics_tools.json', 'software_image_processing': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/image_processing_tools.json', 'software_machine_learning': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/machine_learning_tools.json', 'software_neuroscience': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/neuroscience_tools.json', 'software_physics_astronomy': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/physics_astronomy_tools.json', 'software_scientific_computing': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/scientific_computing_tools.json', 'software_single_cell': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/single_cell_tools.json', 'software_structural_biology': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/structural_biology_tools.json', 'software_visualization': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/packages/visualization_tools.json', 'special_tools': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/special_tools.json', 'spliceai': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/spliceai_tools.json', 'sra': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sra_tools.json', 'stitch': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/stitch_tools.json', 'string_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/string_ext_tools.json', 'string_network': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/string_network_tools.json', 'sunrise_sunset': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/sunrise_sunset_tools.json', 'survival': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/survival_tools.json', 'swiss_target': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/swiss_target_tools.json', 'swissadme': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/swissadme_tools.json', 'swissdock': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/swissdock_tools.json', 'swissmodel': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/swissmodel_tools.json', 'synbiohub': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/synbiohub_tools.json', 'synergxdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/synergxdb_tools.json', 't3db': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/t3db_tools.json', 'targetmine': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/targetmine_tools.json', 'tcdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/tcdb_tools.json', 'tcia': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/tcia_tools.json', 'therasabdab': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/therasabdab_tools.json', 'three_d_beacons': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/three_d_beacons_tools.json', 'timer': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/timer_tools.json', 'tool_composition': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/tool_composition_tools.json', 'tool_discovery_agents': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/tool_discovery_agents.json', 'tool_finder': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/finder_tools.json', 'tooluniverse_page': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/tooluniverse_page_tools.json', 'ucsc_genome': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/ucsc_genome_tools.json', 'umls': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/umls_tools.json', 'unichem': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/unichem_tools.json', 'uniparc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uniparc_tools.json', 'uniprot': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uniprot_tools.json', 'uniprot_idmapping': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uniprot_idmapping_tools.json', 'uniprot_locations': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uniprot_locations_tools.json', 'uniprot_proteomes': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uniprot_proteomes_tools.json', 'uniprot_ref': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uniprot_ref_tools.json', 'uniprot_taxonomy': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uniprot_taxonomy_tools.json', 'uniref': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uniref_tools.json', 'unpaywall': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/unpaywall_tools.json', 'url': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/url_fetch_tools.json', 'uscensus': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uscensus_tools.json', 'usgs_earthquake': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/usgs_earthquake_tools.json', 'usgs_water': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/usgs_water_tools.json', 'uspto': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/uspto_tools.json', 'variant_validator': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/variant_validator_tools.json', 'vdjdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/vdjdb_tools.json', 'veupathdb': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/veupathdb_tools.json', 'visualization_molecule_2d': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/molecule_2d_tools.json', 'visualization_molecule_3d': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/molecule_3d_tools.json', 'visualization_protein_3d': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/protein_structure_3d_tools.json', 'waqi': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/waqi_tools.json', 'web_search_tools': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/web_search_tools.json', 'wfgy_promptbundle': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/wfgy_promptbundle_tools.json', 'who_gho': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/who_gho_tools.json', 'wikidata_entity': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/wikidata_entity_tools.json', 'wikidata_sparql': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/wikidata_sparql_tools.json', 'wikipathways': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/wikipathways_tools.json', 'wikipathways_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/wikipathways_ext_tools.json', 'wikipedia': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/wikipedia_tools.json', 'wikipedia_ext': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/wikipedia_ext_tools.json', 'worldbank': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/worldbank_tools.json', 'wormbase': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/wormbase_tools.json', 'worms': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/worms_tools.json', 'xenbase': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/xenbase_tools.json', 'xml': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/xml_tools.json', 'zenodo': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/zenodo_tools.json', 'zfin': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/zfin_tools.json', 'zinc': '/home/runner/work/ToolUniverse/ToolUniverse/src/tooluniverse/data/zinc_tools.json'}, keep_default_tools=True, log_level=None, hooks_enabled=False, hook_config=None, hook_type=None, enable_name_shortening=False, profile=None, workspace=None, use_global=False)[源代码]

初始化 ToolUniverse 并加载工具文件配置。

参数:
  • tool_files (dict, optional) – 将类别名称映射到 JSON 文件路径的字典。默认为 default_tool_files。

  • keep_default_tools (bool, optional) – 当提供自定义 tool_files 时,是否保留默认工具。默认值为 True。

  • log_level (str, optional) – 此实例的日志级别。可设置为 ‘DEBUG’、’INFO’、’WARNING’、’ERROR’、’CRITICAL’。如果为 None,则使用全局设置。

  • hooks_enabled (bool, optional) – 是否启用输出钩子。默认为 False。

  • hook_config (dict, optional) – 钩子的配置。如果为 None,则使用默认配置。

  • hook_type (str or list, optional) – 简单的钩子类型选择。可以是 ‘SummarizationHook’、’FileSaveHook’,或两者的列表。默认为 ‘SummarizationHook’。如果同时提供了 hook_config 和 hook_type,则以 hook_config 为优先。

  • enable_name_shortening (bool, optional) – Whether to enable automatic tool name shortening for MCP compatibility. Defaults to False.

  • profile (str, optional) – URI of a Profile configuration to load automatically (e.g. "./my-profile.yaml", "hf:user/repo"). Overrides the TOOLUNIVERSE_PROFILE environment variable. When provided, load_profile() is called after initialization.

  • workspace (str, optional) – Path to the local workspace directory for user-defined tools. Overrides the TOOLUNIVERSE_HOME environment variable and the default ./.tooluniverse directory.

  • use_global (bool, optional) – When True, use the global ~/.tooluniverse directory as the default workspace instead of ./.tooluniverse. Has no effect if workspace or TOOLUNIVERSE_HOME is set.

static _resolve_workspace(workspace, use_global=False)[源代码]

Resolve the effective workspace directory.

Priority order: 1. workspace parameter (if provided) — directory is created if absent 2. TOOLUNIVERSE_HOME environment variable — directory is created if absent 3. ~/.tooluniverse when use_global=True 4. ./.tooluniverse (current directory, default local mode)

The default directories (3 & 4) are NOT auto-created; if they do not exist no workspace tools are loaded and workspace profile.yaml is silently skipped.

register_custom_tool(tool_class, tool_name=None, tool_config=None, instantiate=False, tool_instance=None)[源代码]

Register a custom tool class or instance at runtime.

参数:
  • tool_class – The tool class to register (required if tool_instance is None)

  • tool_name (str, optional) – 注册名称。如果未指定,则使用类名。

  • tool_config (dict, optional) – 工具配置字典以添加到 all_tools

  • instantiate (bool, optional) – If True, immediately instantiate and cache the tool. Defaults to False for backward compatibility.

  • tool_instance (optional) – Pre-instantiated tool object. If provided, tool_class is inferred from the instance.

返回:

工具注册时使用的名称

返回类型:

str

示例

# Register tool class only (lazy instantiation) tu.register_custom_tool(MyTool, tool_config={…})

# Register and immediately instantiate tu.register_custom_tool(MyTool, tool_config={…}, instantiate=True)

# Register pre-instantiated tool instance = MyTool({…}) tu.register_custom_tool(tool_class=MyTool, tool_instance=instance, tool_config={…})

force_full_discovery()[源代码]

强制进行完整的工具发现,立即导入所有工具模块。

这在您需要确保所有工具立即可用、绕过延迟加载时非常有用。

返回:

更新的工具注册表包含所有已发现的工具

返回类型:

dict

get_lazy_loading_status()[源代码]

获取有关延迟加载状态和可用工具的信息。

返回:

具有惰性加载状态和工具计数的字典

返回类型:

dict

get_tool_types()[源代码]

获取工具文件中可用的工具类型。

返回:

工具类型名称列表(类别键)。

返回类型:

list

_get_api_key(key_name)[源代码]

Get API key from environment variables.

_check_api_key_requirements(tool_config)[源代码]

Check if a tool’s required API keys are available. Also supports optional_api_keys which enhance performance but don’t block loading.

参数:

tool_config (dict) – 工具配置包含可选的“required_api_keys”和“optional_api_keys”字段

返回:

(bool, list) - (all_keys_available, missing_keys) (布尔值, 列表)-(all_keys_available, missing_keys)

返回类型:

tuple

generate_env_template(all_missing_keys, output_file='.env.template')[源代码]

Generate a template .env file with all required API keys (only writes if content changed).

_create_hook_config_from_type(hook_type)[源代码]

Create hook configuration from simple hook_type parameter.

参数:

hook_type (str or list) – 启用的钩子类型。可以是 ‘SummarizationHook’、’FileSaveHook’,或两者的列表。

返回:

Generated hook configuration

返回类型:

dict

load_tools(categories=None, tool_type=None, exclude_tools=None, exclude_categories=None, include_tools=None, tool_config_files=None, tools_file=None, include_tool_types=None, exclude_tool_types=None, python_files=None, quiet=True)[源代码]

Load tools into the instance, with optional filtering.

参数:
  • categories (list, optional) – Tool category names to load. If None, all categories are loaded. Use list_categories() to see available names.

  • tool_type (list, optional) – Deprecated alias for categories.

  • exclude_tools (list, optional) – Tool names to exclude. Supports glob patterns (e.g. ["EuropePMC_*"]).

  • exclude_categories (list, optional) – Category names to skip entirely.

  • include_tools (list or str, optional) – Only load these tools. Supports glob patterns (e.g. ["EuropePMC_*", "ChEMBL_*"]). Pass a file path string to read names from a text file (one per line).

  • tool_config_files (dict, optional) – Extra JSON config files to load. Format: {"category_name": "/path/to/config.json"}.

  • tools_file (str, optional) – Deprecated. Pass a file path to include_tools instead.

  • python_files (list, optional) – List of Python file paths (str or Path) to import as user tools. Each file should contain @register_tool-decorated classes. Example: python_files=["/path/to/my_tool.py"].

  • include_tool_types (list, optional) – Only load tools whose type field is in this list (e.g. ["RESTTool", "GraphQLTool"]).

  • exclude_tool_types (list, optional) – Skip tools whose type field is in this list.

  • quiet (bool, optional) – Suppress missing-API-key warnings and .env.template generation. Default True. Pass False to see which keys are missing.

示例

# Load everything (default) tu.load_tools()

# Load only two categories tu.load_tools(categories=[“ChEMBL”, “EuropePMC”])

# Load tools by name with glob wildcards tu.load_tools(include_tools=[“EuropePMC_*”, “ChEMBL_get_molecule_*”])

# Combine: exclude one category, exclude specific tools tu.load_tools(

exclude_categories=[“tool_finder”], exclude_tools=[“EuropePMC_slow_tool”],

请提供需要翻译的具体英文文本,我将为您提供符合要求的中文翻译。

_load_tool_names_from_file(file_path)[源代码]

Load tool names from a text file (one tool name per line).

参数:

file_path (str) – 指向包含工具名称的文本文件的路径

返回:

List of tool names loaded from the file

返回类型:

list

_filter_and_deduplicate_tools(exclude_tools_set, include_tools_set, include_tool_types_set=None, exclude_tool_types_set=None, existing_tool_names=None, quiet=True)[源代码]

Filter tools based on inclusion/exclusion criteria and remove duplicates.

参数:
  • exclude_tools_set (set) – 要排除的工具名称集合

  • include_tools_set (set or None) – Set of tool names to include (if None, include all)

  • include_tool_types_set (set or None) – Set of tool types to include (if None, include all)

  • exclude_tool_types_set (set or None) – Set of tool types to exclude (if None, exclude none)

  • existing_tool_names (set or None) – Set of tool names that were already loaded before this call. These tools will be preserved even if not in include_tools_set. Used for merge mode when loading specific tools.

_get_user_tool_files()[源代码]

Return (python_files, json_files) from the configured workspace directory.

self._workspace_dir is always set (defaults to ./.tooluniverse for local mode, or ~/.tooluniverse when use_global=True). If the directory does not exist, an empty list pair is returned.

Supports two layout conventions: - Flat: *.py / *.json directly in the workspace root - Organised: tools/*.py and data/ or configs/*.json

_import_user_python_tools(python_files)[源代码]

Import user Python tool files so their @register_tool decorators run.

Uses spec_from_file_location so files do not need to live inside the tooluniverse package. Each file is registered in sys.modules under a name derived from its path hash. On subsequent calls, the file’s mtime is compared to the cached value; if the file was edited, the module is reloaded so the changes take effect without a process restart.

_load_user_json_configs(json_files)[源代码]

Load JSON tool configs from user directories and append to all_tools.

Each file may contain a single config dict or a list of config dicts. Files named ‘profile.yaml’ / ‘profile.json’ are skipped (handled separately).

_load_tools_from_sources(loader, sources)[源代码]

Phase 4: Load Python tool files and JSON configs from external Profile sources.

Each entry in sources is a URI (local path, hf:user/repo, GitHub URL, or https:// file URL). The URI is resolved to a local directory by ProfileLoader.resolve_to_local_dir(), which handles downloading and caching automatically. The directory is then scanned for tool files using ProfileLoader.get_tool_files_from_dir().

Last-seen definition wins: sources are processed in order, so later entries override earlier ones for duplicate tool names.

参数:
  • loaderProfileLoader instance (already has a cache dir).

  • sources (list) – List of URI strings from the Profile config’s sources field.

_load_auto_discovered_configs()[源代码]

Load auto-discovered configs from the decorator registry and sub-package list registry.

Configs registered via @register_tool(config=...) are loaded from the singleton-per-type config registry. Configs registered by sub-package __init__.py files via register_tool_configs() are loaded from the flat list registry — this supports multiple tool instances per class (e.g. JLCSearch has 8 distinct configs).

_process_mcp_auto_loaders()[源代码]

Process any MCPAutoLoaderTool instances to automatically discover and register MCP tools.

此方法会扫描所有已加载的工具,查找MCPAutoLoaderTool实例,并运行其自动发现过程,从配置的服务器中查找并注册MCP工具。它能够正确处理异步操作,并包含清理和错误处理机制。

副作用:
  • May add new tools to the tool registry

  • Prints debug information about the discovery process

  • 在MCP注册后更新工具计数

list_built_in_tools(mode='config', scan_all=False)[源代码]

列出所有内置工具类别及其统计数据,并区分不同模式。

此方法提供了对 ToolUniverse 中所有可用工具的全面概览,并按类别进行组织。它直接从默认工具文件中读取数据以收集统计信息,因此即使在调用 load_tools() 之前也能正常工作。

参数:
  • mode (str, optional) – 工具的组织模式。默认值为 ‘config’。 - ‘config’:按照配置文件类别组织(原始行为) - ‘type’:按照工具类型(实现类)组织 - ‘list_name’:返回所有工具名称的列表 - ‘list_spec’:返回所有工具规格的列表

  • scan_all (bool, optional) – 是否递归扫描数据目录中的所有 JSON 文件。如果为 True,则扫描 data/ 及其子目录中的所有 JSON 文件。如果为 False(默认值),则使用预定义的工具文件映射。

返回:

  • 对于“config”和“type”模式:包含工具统计信息的字典

  • 对于“list_name”模式:所有工具名称的列表

  • 对于“list_spec”模式:所有工具规格的列表

返回类型:

dict or list

示例

>>> tool_universe = ToolUniverse()
>>> # Group by config file categories (predefined files only)
>>> stats = tool_universe.list_built_in_tools(mode='config')
>>> # Scan all JSON files in data directory recursively
>>> stats = tool_universe.list_built_in_tools(mode='config', scan_all=True)
>>> # Get all tool names from all JSON files
>>> tool_names = tool_universe.list_built_in_tools(mode='list_name', scan_all=True)

备注

  • 此方法直接从工具文件中读取,无需调用 load_tools()。

  • 工具已在各类别中去重,因此同一工具不会被多次计数。

  • 当调用此方法时,摘要会自动打印到控制台(list_name 和 list_spec 模式除外)。

  • 当 scan_all=True 时,系统会扫描 data/ 目录及其子目录中的所有 JSON 文件

_read_tools_from_file(file_path)[源代码]

从单个JSON文件中读取工具,并进行错误处理。

参数:

file_path (str) – Path to the JSON file

返回:

List of tool configurations from the file

返回类型:

list

_scan_predefined_files()[源代码]

扫描预定义的工具文件(原始行为)。

返回:

(all_tools, all_tool_names),其中 all_tools 是工具配置的列表,all_tool_names 是用于去重的工具名称集合

返回类型:

tuple

_scan_all_json_files()[源代码]

Recursively scan all JSON files in the data directory and its subdirectories.

返回:

(all_tools, all_tool_names),其中 all_tools 是工具配置的列表,all_tool_names 是用于去重的工具名称集合

返回类型:

tuple

refresh_tool_name_desc(enable_full_desc=False, include_names=None, exclude_names=None, include_categories=None, exclude_categories=None)[源代码]

使用可选的筛选条件刷新工具名称和描述映射。

此方法会重建内部工具字典,并根据提供的过滤条件生成经过筛选的工具名称和描述列表。

参数:
  • enable_full_desc (bool, optional) – 如果为 True,则将完整的工具 JSON 作为描述包含在内。如果为 False,则使用“名称: 描述”格式。默认为 False。

  • include_names (list, optional) – 包含的工具名称列表。

  • exclude_names (list, optional) – 要排除的工具名称列表。

  • include_categories (list, optional) – 包含的类别列表。

  • exclude_categories (list, optional) – 要排除的类别列表。

返回:

过滤后包含 (tool_name_list, tool_desc_list) 的元组。

返回类型:

tuple

prepare_one_tool_prompt(tool)[源代码]

为便捷使用准备单一工具配置,筛选出必要的关键项。

参数:

tool (dict) – 工具配置字典

返回:

仅使用必要的键进行工具配置以实现提示功能。

返回类型:

dict

prepare_tool_prompts(tool_list, mode='prompt', valid_keys=None)[源代码]

Prepare a list of tool configurations for different usage modes.

参数:
  • tool_list (list) – 工具配置字典列表

  • mode (str) – 准备模式。选项: - ‘prompt’:保留用于提示的必要键(name、description、parameter、required) - ‘example’:保留用于示例的扩展键(name、description、parameter、required、query_schema、fields、label、type) - ‘custom’:使用自定义的 valid_keys 参数

  • valid_keys (list, optional) – 自定义模式下保留的键列表(mode=’custom’)。

返回:

List of tool configurations with only specified keys.

返回类型:

list

get_tool_specification_by_names(tool_names, format='default')[源代码]

使用 tool_specification 方法通过工具名称检索工具规格。

参数:
  • tool_names (list) – 工具名称检索列表

  • format (str, optional) – 输出格式。选项:’default’,’openai’。如果选择 ‘openai’,将返回 OpenAI 函数调用格式。默认值为 ‘default’。

返回:

指定名称的工具规格列表。未找到的工具将被报告,但不会包含在结果中。

返回类型:

list

get_one_tool_by_one_name(tool_name, return_prompt=True)[源代码]

根据名称检索单个工具规格,可选择准备用于提示。

这是一个便捷方法,用于调用 get_one_tool_by_one_name。

参数:
  • tool_name (str) – 要检索的工具名称。

  • return_prompt (bool, optional) – 如果为 True,则返回用于提示的工具;如果为 False,则返回完整的工具配置。默认为 True。

返回:

如果找到工具配置,则返回;否则返回None。

返回类型:

dict or None

_sanitize_schema_for_openai(schema)[源代码]

Recursively sanitize a JSON Schema object for OpenAI function calling compatibility.

Handles three categories of issues that cause OpenAI to reject schemas:

  1. Legacy required flagsrequired: True/False embedded on individual property schemas (not valid JSON Schema). Collected and rebuilt as a proper top-level required array on the enclosing object schema.

  2. Array type unionstype: ["string", "null"] (JSON Schema draft-4 shorthand). OpenAI only accepts a single string for type; this converts them to anyOf: [{"type": "string"}, {"type": "null"}].

  3. ``additionalProperties: True`` — OpenAI’s validator rejects this value; the key is removed.

Recurses into properties, items, and anyOf / oneOf / allOf so that deeply-nested sub-schemas are also cleaned up.

参数:

schema (dict) – A JSON Schema dict to sanitize (not mutated in place).

返回:

A new dict with all issues resolved.

返回类型:

dict

tool_specification(tool_name, return_prompt=False, format='default')[源代码]

根据名称检索单个工具配置。

参数:
  • tool_name (str) – 要检索的工具名称。

  • return_prompt (bool, optional) – 如果为 True,则返回用于提示的工具。 如果为 False,则返回完整的工具配置。 默认为 False。

  • format (str, optional) – 输出格式。选项:’default’,’openai’。如果选择 ‘openai’,将返回 OpenAI 函数调用格式。默认值为 ‘default’。

返回:

如果找到工具配置,则返回;否则返回None。

返回类型:

dict or None

get_tool_type_by_name(tool_name)[源代码]

通过工具的名称获取其类型。

参数:

tool_name (str) – 工具名称。

返回:

工具的类型。

返回类型:

str

抛出:

KeyError – 如果在已加载的工具中未找到工具名称。

call_id_gen()[源代码]

为函数调用生成随机呼叫ID。

返回:

由字母和数字组成的随机9字符字符串。

返回类型:

str

tool_to_str(tool_list)[源代码]

将工具配置列表转换为格式化字符串。

参数:

tool_list (list) – 工具配置字典列表

返回:

JSON 格式的字符串表示工具,每个工具之间用两个换行符分隔。

返回类型:

str

extract_function_call_json(lst, return_message=False, verbose=True, format='llama')[源代码]

从输入数据中提取函数调用的 JSON。

该方法委托给工具函数 extract_function_call_json。

参数:
  • lst – 包含函数调用信息的输入数据。

  • return_message (bool, optional) – 是否随 JSON 一并返回消息。默认值为 False。

  • verbose (bool, optional) – 是否启用详细输出。默认值为 True。

  • format (str, optional) – 提取的格式类型。默认值为“llama”。

返回:

函数调用 JSON,可选包含消息内容(当 return_message 为 True 时)。

返回类型:

dict or tuple

return_all_loaded_tools()[源代码]

返回所有已加载工具的深拷贝。

返回:

对 all_tools 列表进行深拷贝以防止外部修改。

返回类型:

list

_execute_function_call_list(function_calls, stream_callback=None, use_cache=False, max_workers=None)[源代码]

执行一系列函数调用,可选择并行执行。

参数:
  • function_calls (List[Dict[str, Any]]) – Ordered list of function call dictionaries.

  • stream_callback – 可选的流式回调。

  • use_cache (bool) – Whether to enable cache lookups for each call.

  • max_workers (int | None) – 最大并行工作线程数;值 <=1 时将回退到顺序执行。

返回:

与``function_calls``顺序对齐的结果列表。

返回类型:

List[Any]

_build_batch_jobs(function_calls)[源代码]
_prime_batch_cache(jobs, use_cache, results)[源代码]
_execute_batch_jobs(jobs_to_run, results, *, stream_callback, use_cache, max_workers)[源代码]
_ensure_tool_instance(job)[源代码]
_get_tool_semaphore(job, tool_semaphores)[源代码]
run(fcall_str, return_message=False, verbose=True, format='llama', stream_callback=None, use_cache=False, max_workers=None)[源代码]

Context-aware execution - works in both sync and async contexts.

In sync context:

result = tu.run(…) # Returns result directly (may block for async tools)

In async context:

result = await tu.run(…) # Returns coroutine, non-blocking

This method automatically detects the context and behaves appropriately.

参数:
  • fcall_str – 输入字符串或数据,其中包含函数调用信息。

  • return_message (bool, optional) – 是否返回格式化的消息。默认为 False。

  • verbose (bool, optional) – 是否启用详细输出。默认值为 True。

  • format (str, optional) – 解析的格式类型。默认值为“llama”。

  • stream_callback – Optional callback for streaming responses.

  • use_cache (bool, optional) – Whether to use result caching. Defaults to False.

  • max_workers (Optional[int]) – Max workers for parallel batch execution (sync only).

返回:

Result (sync) or coroutine (async) depending on context.

_run_sync(fcall_str, return_message=False, verbose=True, format='llama', stream_callback=None, use_cache=False, max_workers=None)[源代码]

Synchronous execution implementation (original run logic).

For async tools, this will create an event loop if needed.

_format_batch_as_messages(batch_results, function_call_json, message)[源代码]

Format batch results as tool/assistant message dicts for return_message mode.

async _run_async(fcall_str, return_message=False, verbose=True, format='llama', stream_callback=None, use_cache=False)[源代码]

Asynchronous execution implementation (non-blocking).

Handles both sync and async tools in async context.

async _execute_function_call_list_async(function_call_list, stream_callback=None, use_cache=False)[源代码]

Execute multiple function calls asynchronously and in parallel.

Uses return_exceptions=True so one failure does not abort others.

_resolve_tool_name(function_name)[源代码]

Resolve tool name to its primary identifier.

Uses the ToolNameMapper to handle: 1. Aliases (e.g., old tool names) -> primary name 2. Original names -> shortened names (if shortening enabled) 3. Already primary names -> return as-is

参数:

function_name (str) – Tool name (can be alias, original, or shortened)

返回:

Resolved tool name (primary identifier in all_tool_dict)

返回类型:

str

run_one_function(function_call_json, stream_callback=None, use_cache=False, validate=True)[源代码]

执行单个函数调用。

此方法用于验证函数调用,必要时初始化工具,并使用提供的参数执行。如果启用了钩子,还会应用输出钩子来处理结果。

参数:
  • function_call_json (dict) – 包含函数名称和参数的字典。

  • stream_callback (callable, optional) – Callback for streaming responses.

  • use_cache (bool, optional) – Whether to use result caching. Defaults to False.

  • validate (bool, optional) – Whether to validate parameters against schema. Defaults to True.

返回:

工具执行结果,或在验证失败时返回的错误信息。

返回类型:

str or dict

async run_one_function_async(function_call_json, stream_callback=None, use_cache=False, validate=True)[源代码]

Async version of run_one_function.

Execute a single function call asynchronously (non-blocking). Handles both sync and async tools intelligently.

_execute_tool_with_stream(tool_instance, arguments, stream_callback, use_cache=False, validate=True)[源代码]

调用工具时,在支持的情况下转发流回调和其他参数。

async _invoke_tool_async(tool_instance, tool_arguments, **kwargs)[源代码]

Invoke tool.run, using await for async tools or a thread pool for sync tools.

async _execute_tool_with_stream_async(tool_instance, arguments, stream_callback, use_cache=False, validate=True)[源代码]

Async version of _execute_tool_with_stream.

Handles both sync and async tools: async tools are awaited directly, sync tools run in a thread pool.

toggle_hooks(enabled)[源代码]

在全局范围内启用或禁用输出钩子。

此方法允许在运行时控制挂钩系统。启用时,如果 HookManager 尚未初始化,则会对其进行初始化。禁用时,则会停用 HookManager。

参数:

enabled (bool) – True 表示启用钩子,False 表示禁用

init_tool(tool=None, tool_name=None, add_to_cache=True)[源代码]

从配置或名称初始化工具实例。

此方法使用工具类型映射创建一个新的工具实例,并可选择将其缓存以供将来使用。它还处理一些特殊情况,例如 OpentargetToolDrugNameMatch,这种情况需要额外的依赖项。

参数:
  • tool (dict, optional) – 工具配置字典。必须提供此项或 tool_name。

  • tool_name (str, optional) – 用于初始化的工具类型名称。必须提供此项或工具。

  • add_to_cache (bool, optional) – 是否缓存已初始化的工具。默认为 True。

返回:

Initialized tool instance or None if initialization fails.

返回类型:

object

抛出:

KeyError – 如果在 tool_type_mappings 中未找到工具类型。

_get_tool_instance(function_name, cache=True)[源代码]

获取或创建工具实例,可选择启用缓存。

_auto_load_tools_if_empty(function_name=None)[源代码]

Automatically load tools if the tools dictionary is empty.

参数:

function_name (str) – Optional tool name to check after loading

返回:

True if tools were loaded successfully, False otherwise

返回类型:

bool

_make_cache_key(function_name, arguments, tool_instance=None)[源代码]

Generate cache key by delegating to BaseTool.

参数:
  • function_name (str) – Name of the tool/function

  • arguments (dict) – Arguments passed to the tool

  • tool_instance – Optional pre-fetched tool instance to avoid recreation

返回:

Cache key string

返回类型:

str

_coerce_value_to_type(value, schema)[源代码]

Coerce a value to match the schema’s expected type.

This function attempts to convert string values to integers, floats, or booleans when the schema expects those types. This makes the system more lenient with user input from LLMs that provide numeric values as strings.

参数:
  • value (Any) – The value to coerce

  • schema (dict) – The JSON schema definition for this value

返回:

The coerced value (or original if coercion fails or not applicable)

返回类型:

Any

_coerce_arguments_to_schema(function_name, arguments)[源代码]

Coerce all arguments for a tool to match their schema expectations.

参数:
  • function_name (str) – Name of the tool

  • arguments (dict) – Dictionary of arguments to coerce

返回:

New dictionary with coerced arguments

返回类型:

dict

_validate_parameters(function_name, arguments)[源代码]

Validate parameters by delegating to BaseTool.

_check_basic_type(value, expected_type)[源代码]

检查值是否符合预期的基本类型。

_classify_exception(exception, function_name, arguments)[源代码]

Classify exception by delegating to BaseTool.

_create_dual_format_error(error)[源代码]

创建双格式错误响应以实现向后兼容。

refresh_tools()[源代码]

Re-scan workspace and reload all tool configurations.

Picks up new JSON/Python tool files added to the workspace .tooluniverse/tools/ directory since startup, and re-discovers entry-point plugins installed since the process started. Clears the existing tool registry first so the result is always a clean reload.

eager_load_tools(names=None)[源代码]

预先实例化工具以减少首次调用的延迟。

property _cache

用于测试目的访问内部缓存。

clear_cache()[源代码]

清除结果缓存。

clear_tools(clear_cache=False)[源代码]

Clear all loaded tools from the registry.

This method resets the tool registry to its initial empty state, allowing you to: - Free memory after loading many tools - Reset state between different workflows - Load a fresh set of tools for a new context - Control which tools are visible to tool finder

参数:

clear_cache (bool, optional) – Whether to also clear the result cache. Defaults to False.

示例

# Clear tools but keep cached results tu.clear_tools()

# Clear both tools and cached results tu.clear_tools(clear_cache=True)

# Load specific tools after clearing tu.clear_tools() tu.load_tools(include_tools=[“UniProt_get_entry_by_accession”])

备注

  • This does not affect tool instances in callable_functions cache

  • Subsequent tool access will trigger on-demand loading

  • Use clear_cache=True if you also want to clear result cache

get_cache_stats()[源代码]

返回缓存统计数据。

dump_cache(namespace=None)[源代码]

遍历缓存条目(仅限持久层)。

close()[源代码]

释放资源。

get_tool_health(tool_name=None)[源代码]

获取工具的健康状态。

check_function_call(fcall_str, function_config=None, format='llama')[源代码]

验证函数调用是否符合工具配置。

此方法通过验证函数名称是否存在以及参数是否与预期参数匹配来检查函数调用的有效性。

参数:
  • fcall_str – 函数调用字符串或需验证的数据。

  • function_config (dict, optional) – 特定功能配置以进行验证。如为 None,则使用已加载的工具配置。

  • format (str, optional) – 解析的格式类型。默认值为“llama”。

返回:

一个包含 (is_valid, message) 的元组,其中: - is_valid (bool):如果函数调用有效,则为 True;否则为 False - message (str):无效时的错误信息,有效时为空字符串

返回类型:

tuple

export_tool_names(output_file, category_filter=None)[源代码]

将工具名称导出到文本文件(每行一个)。

参数:
  • output_file (str) – 输出文件路径

  • category_filter (list, optional) – 可筛选的类别列表

filter_tools(include_tools=None, exclude_tools=None, include_tool_types=None, exclude_tool_types=None)[源代码]

Filter tools based on inclusion/exclusion criteria.

参数:
  • include_tools (set, optional) – Set of tool names to include

  • exclude_tools (set, optional) – 要排除的工具名称集合

  • include_tool_types (set, optional) – Set of tool types to include

  • exclude_tool_types (set, optional) – Set of tool types to exclude

返回:

Filtered list of tool configurations

返回类型:

list

get_required_parameters(tool_name)[源代码]

Get required parameters for a specific tool.

参数:

tool_name (str) – Name of the tool

返回:

List of required parameter names

返回类型:

list

get_available_tools(category_filter=None, name_only=True)[源代码]

获取可用工具,并可选择按类别筛选。

参数:
  • category_filter (list, optional) – 可筛选的类别列表

  • name_only (bool) – 如果为 True,则仅返回工具名称;如果为 False,则返回完整配置

返回:

工具名称或工具配置列表

返回类型:

list

find_tools_by_pattern(pattern, search_in='name', case_sensitive=False)[源代码]

查找名称或描述中与模式匹配的工具。

参数:
  • pattern (str) – 搜索模式

  • search_in (str) – 搜索范围 - “名称”、“描述”或“两者”

  • case_sensitive (bool) – 是否应区分搜索的大小写

返回:

匹配工具配置列表

返回类型:

list

get_tool_by_name(tool_names, format='default')[源代码]

根据工具名称检索配置。

已弃用:请改用 tool_specification()。

参数:
  • tool_names (list) – 工具名称检索列表

  • format (str, optional) – 输出格式。选项:’default’,’openai’。如果选择 ‘openai’,将返回 OpenAI 函数调用格式。默认值为 ‘default’。

返回:

指定名称的工具配置列表。未找到的工具将被报告,但不会包含在结果中。

返回类型:

list

get_tool_description(tool_name)[源代码]

根据工具名称获取其描述。

已弃用:请改用 tool_specification()。

参数:

tool_name (str) – 工具名称。

返回:

如果找到工具配置,则返回;否则返回None。

返回类型:

dict or None

remove_keys(tool_list, invalid_keys)[源代码]

从工具配置列表中移除指定的键。

已弃用:请使用 prepare_tool_prompts(mode=’custom’, valid_keys=…) 替代。

参数:
  • tool_list (list) – 工具配置字典列表

  • invalid_keys (list) – 每个工具配置中需要移除的键列表。

返回:

深度复制工具列表,并移除指定的键。

返回类型:

list

prepare_tool_examples(tool_list)[源代码]

为示例使用准备工具配置,同时保留扩展的密钥集合。

已弃用:请改用 prepare_tool_prompts(mode=’example’)。

参数:

tool_list (list) – 工具配置字典列表

返回:

仅复制工具列表中与示例相关的键的深拷贝。

返回类型:

list

select_tools(include_names=None, exclude_names=None, include_categories=None, exclude_categories=None)[源代码]

根据工具名称和/或类别(tool_files 键)选择工具。

已弃用:请改用 filter_tools()。

参数:
  • include_names (list, optional) – 工具名称列表。如果为 None,则包含所有。

  • exclude_names (list, optional) – 要排除的工具名称列表。

  • include_categories (list, optional) – 要包含的类别列表(tool_files 键)。如果为 None,则包含所有类别。

  • exclude_categories (list, optional) – 要排除的类别列表(tool_files 键)。

返回:

已选择工具配置列表

返回类型:

list

filter_tool_lists(tool_name_list, tool_desc_list, include_names=None, exclude_names=None, include_categories=None, exclude_categories=None)[源代码]

根据名称和/或类别直接筛选工具名称和描述列表。

已弃用:请使用 filter_tools() 并手动进行列表过滤。

参数:
  • tool_name_list (list) – 工具名称筛选列表。

  • tool_desc_list (list) – 用于筛选的工具描述列表(必须与 tool_name_list 相对应)。

  • include_names (list, optional) – 包含的工具名称列表。

  • exclude_names (list, optional) – 要排除的工具名称列表。

  • include_categories (list, optional) – 包含的类别列表。

  • exclude_categories (list, optional) – 要排除的类别列表。

返回:

包含 (filtered_tool_name_list, filtered_tool_desc_list) 的元组。

返回类型:

tuple

load_tools_from_names_list(tool_names, clear_existing=True)[源代码]

仅通过工具名称加载特定工具。

已弃用:请改用 load_tools(include_tools=…)。

参数:
  • tool_names (list) – 工具名称加载列表

  • clear_existing (bool) – 是否先清除现有工具

返回:

成功加载的工具数量

返回类型:

int

load_profile(uri, _merge_workspace=True, **kwargs)[源代码]

Load Profile configuration and apply it to the ToolUniverse instance.

This is a high-level method that loads a Profile configuration from various sources (HuggingFace, local files, HTTP URLs) and applies the tool settings to the current instance.

When a workspace profile.yaml exists and _merge_workspace=True (the default), the workspace config is used as the base and the loaded config is deep-merged on top — so any key in the loaded config overrides the workspace default.

参数:
  • uri (str) – Profile URI (e.g., “hf:user/repo”, “./config.yaml”, “https://example.com/config.yaml”)

  • _merge_workspace (bool) – Whether to merge the workspace profile.yaml as a base config. Set to False when auto-applying the workspace yaml itself.

  • **kwargs – Additional parameters to override Profile configuration (e.g., exclude_tools=[“tool1”], include_tools=[“tool2”])

返回:

The loaded (and possibly merged) Profile configuration

返回类型:

dict

示例

# Load from HuggingFace config = tu.load_profile(“hf:community/proteomics-toolkit”)

# Load local file with overrides config = tu.load_profile(“./my-config.yaml”, exclude_tools=[“slow_tool”])

# Load from HTTP URL config = tu.load_profile(”https://example.com/config.yaml”)

_apply_log_level_config(log_level)[源代码]

Apply log level from Profile config.

_apply_cache_config(cache_config)[源代码]

Reconfigure the cache manager from Profile cache settings.

Only the keys present in cache_config are changed; omitted keys keep their current values.

_apply_llm_config(llm_config)[源代码]

Apply LLM configuration from Profile.

参数:

llm_config (Dict[str, Any]) – LLM configuration dictionary

_apply_hooks_config(hooks_config)[源代码]

Apply hooks configuration from Profile.

参数:

hooks_config (List[Dict[str, Any]]) – Hooks configuration list

_load_tools_from_mcp_server(server_url, config)

Load tools from a specific MCP server.

discover_mcp_tools(server_urls=None, **kwargs)

无需加载即可发现 MCP 服务器上的可用工具。

此方法连接到 MCP 服务器,以发现可用的工具,而无需实际将其注册到 ToolUniverse 中。适用于工具的探索和选择性加载。

参数:
  • server_urls (list of str, optional) – 用于发现的 MCP 服务器 URL 列表

  • **kwargs – 附加选项: - timeout (int):连接超时时间(默认值:30) - include_schemas (bool):是否包含工具参数模式(默认值:True)

返回:

按服务器组织的工具发现结果

返回类型:

dict

示例

tu = ToolUniverse()

# Discover what's available
discovery = tu.discover_mcp_tools([
    "http://localhost:8001",
    "http://ml-server:8002"
])

# Show available tools
for server, info in discovery["servers"].items():
    print(f"\n{server}:")
    for tool in info.get("tools", []):
        print(f"  - {tool['name']}: {tool['description']}")
list_mcp_connections()

列出所有活动的MCP连接和已加载的工具。

返回:

关于MCP连接、自动加载器和已加载工具的信息

返回类型:

dict

示例

tu = ToolUniverse()
tu.load_mcp_tools(["http://localhost:8001"])

connections = tu.list_mcp_connections()
print(f"Active MCP connections: {len(connections['connections'])}")
load_mcp_tools(server_urls=None, **kwargs)

将MCP工具从远程服务器加载到此ToolUniverse实例中。

此方法会自动从MCP服务器中发现工具,并将其注册为ToolUniverse工具,从而实现远程功能的无缝使用。

参数:
  • server_urls (list of str, optional) – MCP 服务器 URL 列表,用于加载工具。 示例: - [”http://localhost:8001”, “http://analysis-server:8002”] - [“ws://localhost:9000”] # WebSocket MCP 服务器 如果为 None,将尝试从本地 MCP 工具注册表中发现。

  • **kwargs – 附加配置选项: - tool_prefix (字符串): 加载工具名称的前缀(默认值:”mcp_”) - timeout (整数): 连接超时时间(单位:秒,默认值:30) - auto_register (布尔值): 是否自动注册发现的工具(默认值:True) - selected_tools (列表): 从每个服务器加载的特定工具 - categories (列表): 用于筛选的工具类别

返回:

加载工具的摘要,包括数量统计及遇到的任何错误。

返回类型:

dict

示例

Load from specific servers:

tu = ToolUniverse()

# Load tools from multiple MCP servers
result = tu.load_mcp_tools([
    "http://localhost:8001",  # Local analysis server
    "http://ml-server:8002",  # Remote ML server
    "ws://realtime:9000"      # WebSocket server
])

print(f"Loaded {result['total_tools']} tools from {result['servers_connected']} servers")

Load with custom configuration:

tu.load_mcp_tools(
server_urls=["http://localhost:8001"],
tool_prefix="analysis\_",
timeout=60,
selected_tools=["protein_analysis", "drug_interaction"]

从本地注册表自动发现: `python # 如果您已在本地注册了 MCP 工具,自动发现其服务器 tu.load_mcp_tools()  # 使用来自 mcp_tool_registry 的服务器 `

_store_profile_metadata(config)[源代码]

Store Profile metadata for reference.

参数:

config (Dict[str, Any]) – Profile configuration dictionary

get_profile_llm_config()[源代码]

Get the current Profile LLM configuration.

返回:

LLM configuration dictionary or None if not set

返回类型:

Dict[str, Any] | None

get_profile_metadata()[源代码]

Get the current Profile metadata.

返回:

Profile metadata dictionary or None if not set

返回类型:

Dict[str, Any] | None

class tooluniverse.BaseTool[源代码]

基类:object

STATIC_CACHE_VERSION = '1'
__init__(tool_config)[源代码]
classmethod get_default_config_file()[源代码]

获取此工具类型的默认配置文件路径。

此方法使用一种稳健的路径解析策略,可适用于不同的安装场景:

  1. 已安装的软件包:使用 importlib.resources 以正确访问软件包资源

  2. 开发模式:回退到基于文件的路径解析

  3. 遗留版 Python:处理 importlib.resources 和 importlib_resources

在子类中重写此方法以指定自定义默认值文件。

退货

指向默认文件的路径或资源对象

classmethod load_defaults_from_file()[源代码]

从配置文件加载默认设置

_apply_defaults(tool_config)[源代码]

Apply default configuration to the tool config

run(arguments=None, stream_callback=None, use_cache=False, validate=True)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

check_function_call(function_call_json)[源代码]
get_schema_const_operation()[源代码]

Return the operation value from the tool’s parameter schema, or empty string.

Checks const first (single fixed value), then falls back to the first value in enum (single-value enum is equivalent to const).

get_required_parameters()[源代码]

Retrieve required parameters from the endpoint definition. Returns list: List of required parameters for the given endpoint.

validate_parameters(arguments)[源代码]

Validate parameters against tool schema.

此方法使用 jsonschema 提供标准参数验证。子类可以重写此方法以实现自定义验证逻辑。

参数:

arguments (Dict[str, Any]) – Dictionary of arguments to validate

退货

验证失败时返回 ToolError,验证通过时返回 None

_ERROR_CLASSIFICATION = [({'401', '403', 'api key', 'auth', 'token', 'unauthorized'}, <class 'tooluniverse.exceptions.ToolAuthError'>, 'Authentication failed'), ({'429', 'limit exceeded', 'quota', 'rate limit'}, <class 'tooluniverse.exceptions.ToolRateLimitError'>, 'Rate limit exceeded'), ({'404', 'connection', 'network', 'not found', 'timeout', 'unavailable'}, <class 'tooluniverse.exceptions.ToolUnavailableError'>, 'Tool unavailable'), ({'invalid', 'parameter', 'schema', 'validation'}, <class 'tooluniverse.exceptions.ToolValidationError'>, 'Validation error'), ({'config', 'configuration', 'setup'}, <class 'tooluniverse.exceptions.ToolConfigError'>, 'Configuration error'), ({'dependency', 'import', 'module', 'package'}, <class 'tooluniverse.exceptions.ToolDependencyError'>, 'Dependency error')]
handle_error(exception)[源代码]

将原始异常分类为结构化的 ToolError。

此方法提供标准错误分类。子类可以重写此方法以实现自定义错误处理逻辑。

参数:

exception (Exception) – 用于分类的原始异常

退货

Structured ToolError instance

get_cache_key(arguments)[源代码]

为此工具调用生成缓存键。

此方法提供标准的缓存键生成。子类可以重写此方法以实现自定义的缓存逻辑。

参数:

arguments (Dict[str, Any]) – Dictionary of arguments for the tool call

退货

字符串缓存键

supports_streaming()[源代码]

检查此工具是否支持流式响应。

退货

如果工具支持流式处理,则为 True,否则为 False

supports_caching()[源代码]

检查此工具的结果是否可以缓存。

退货

True if tool results can be cached, False otherwise

get_batch_concurrency_limit()[源代码]

返回批处理运行期间允许的最大并发执行数(0 = 不受限制)。

get_cache_namespace()[源代码]

返回此工具的缓存命名空间标识符。

get_cache_version()[源代码]

为此工具返回稳定的缓存版本指纹。

get_cache_ttl(result=None)[源代码]

返回缓存结果的TTL(秒);None表示无过期时间。

get_tool_info()[源代码]

Get comprehensive information about this tool.

退货

Dictionary containing tool metadata

tooluniverse.register_tool(tool_type_name=None, config=None)[源代码]

用于自动注册工具类及其配置的装饰器。

用法:

@register_tool(‘CustomToolName’, config={…}) class 我的工具:

通过

tooluniverse.get_tool_registry()[源代码]

获取当前工具注册表的副本。

class tooluniverse.SMCP[源代码]

基类:FastMCP

科学模型上下文协议(SMCP)服务器

SMCP 是一个增强版的 MCP(模型上下文协议)服务器,它将 ToolUniverse 的广泛科学工具集合与 FastMCP 框架无缝集成。该服务器为科学计算、数据分析和研究工作流程提供了一个统一的、可由 AI 访问的接口。

SMCP 服务器在标准 MCP 功能的基础上扩展了科学领域的专业知识、智能工具发现功能以及针对研究应用的优化配置。它能够自动处理复杂的任务,通过一致且文档完善的接口公开数百种专业工具。

关键功能:

🔬 科学工具集成:原生支持访问350多种专业工具,涵盖

科学数据库、文献检索、临床数据、基因组学、蛋白质组学、化学信息学,以及基于人工智能的分析功能。

🧠 AI 驱动的工具发现:使用多层次智能搜索系统:
  • ToolFinderLLM:通过预过滤实现成本优化的基于LLM的语义理解

  • Tool_RAG:基于嵌入的相似性搜索

  • 关键词搜索:作为可靠的备用方案,进行简单的文本匹配

📡 全面支持MCP协议:完整实现MCP规范,包括:
  • Standard methods (tools/list, tools/call, resources/, prompts/)

  • 自定义科学方法(tools/find, tools/search)

  • 多传输支持(stdio、HTTP、SSE)

  • JSON-RPC 2.0 兼容性与正确的错误处理

高性能架构:包含可用于生产环境的功能:
  • 用于并发工具执行的可配置线程池

  • 智能工具加载与缓存

  • 资源管理与优雅降级

  • 全面的错误处理与恢复

🔧 开发者友好:通过以下方式简化配置和部署:
  • 科学计算的合理默认设置

  • 灵活的自定义选项

  • 全面的文档与示例

  • 内置诊断和监控工具

自定义MCP方法:

工具/查找:

基于AI的工具发现,支持使用自然语言查询。功能包括语义搜索、类别筛选以及灵活的响应格式。

工具/搜索:

用于工具发现的备用端点,功能与 tools/find 完全相同,提供兼容性和便利性。

Parameters:

namestr, optional

用于日志记录和标识的人类可读服务器名称。 默认值:”SMCP Server” 示例:”Scientific Research API”、”Drug Discovery Server”

tooluniverse_configToolUniverse or dict, optional

如果为预先配置的 ToolUniverse 实例或配置字典。如果为 None,则创建一个具有默认设置的新 ToolUniverse。支持重用现有工具配置和自定义设置。

tool_categorieslist of str, optional

指定要加载的 ToolUniverse 分类。如果设置为 None 且 auto_expose_tools=True,则会加载所有可用工具。常见组合如下: - 科学类: [“ChEMBL”, “uniprot”, “opentarget”, “pubchem”, “hpa”] - 文献类: [“EuropePMC”, “semantic_scholar”, “pubtator”, “agents”] - 临床类: [“fda_drug_label”, “clinical_trials”, “adverse_events”]

exclude_toolslist of str, optional

需要排除加载的特定工具名称。这些工具即使属于已加载的类别,也不会通过MCP界面显示。此功能适用于移除特定存在问题或不需要的工具。

exclude_categorieslist of str, optional

要排除加载的工具类别。这些整个类别将在工具加载过程中被跳过。可以与 tool_categories 配合使用,先选择类别,然后排除特定类别。

include_toolslist of str, optional

如果提供了特定工具名称,则仅加载这些工具,而不考虑类别。这将覆盖基于类别的选择。

tools_filestr, optional

包含工具名称的文本文件路径(每行一个)。作为 include_tools 参数的替代选项。会忽略注释(以 # 开头的行)和空行。

tool_config_filesdict of str, optional

额外的工具配置文件加载。格式:{“category_name”: “/path/to/config.json”}。这些文件将在默认工具文件的基础上加载。

include_tool_typeslist of str, optional

指定要包含的工具类型。如果提供了此选项,则仅加载这些类型的工具。可用的类型包括:’OpenTarget’、’ToolFinderEmbedding’、’ToolFinderKeyword’、’ToolFinderLLM’ 等。

exclude_tool_typeslist of str, optional

要排除加载的工具类型。这些工具类型将在工具加载过程中被跳过。此功能适用于排除整个类别的工具(例如,所有 ToolFinder 类型或所有 OpenTarget 工具)。

profilestr or list of str, optional

Profile configuration URI(s) to load. Can be a single URI string or a list of URIs for loading multiple Profile configurations. Supported formats: - Local file: “./config.yaml” or “/path/to/config.yaml” - HuggingFace: “hf:username/repo” or “hf:username/repo/file.yaml” - HTTP URL: “https://example.com/config.yaml”

When provided, Profile configurations are loaded after tool initialization, applying LLM settings, hooks, and tool selections from the configuration files. Multiple profiles can be loaded sequentially, with later configurations potentially overriding earlier ones.

Example: profile=”./my-workspace.yaml” Example: profile=[“hf:community/bio-tools”, “./custom-tools.yaml”]

auto_expose_toolsbool, default True

是否将 ToolUniverse 工具自动暴露为 MCP 工具。当设置为 True 时,所有加载的工具都会通过 MCP 接口可用,并自动进行模式转换和执行封装。

search_enabledbool, default True

通过 tools/find 方法启用 AI 驱动的工具搜索功能。包括 ToolFinderLLM(基于 LLM 的成本优化方案)、Tool_RAG(基于嵌入技术),以及具有智能回退机制的简单关键词搜索功能。

max_workersint, default 5

用于工具执行的最大并发工作线程数。较高的值允许更多工具并行调用,但会占用更多资源。建议值:5-20,具体取决于服务器容量和预期负载。

hooks_enabledbool, default False

是否启用输出处理钩子以对工具输出进行智能后处理。启用时,钩子可以自动汇总较长的输出、将结果保存到文件中或应用其他转换。

hook_configdict, optional

自定义钩子配置字典。如果提供,将覆盖默认钩子设置。应包含带有钩子定义的 “hooks” 列表。例如:{“hooks”: [{“name”: “summarization_hook”, “type”: “SummarizationHook”, …}]}

hook_typestr, optional

简单的钩子类型选择。可以是“SummarizationHook”、“FileSaveHook”,或者两者的列表。提供了一种无需完整配置即可启用钩子的简便方法。当指定时,优先于 hooks_enabled。

compact_modebool, default False

Enable compact mode that only exposes core tools to prevent context window overflow. When True: - Only exposes search tools (find_tools), execute tool (execute_tool),

and tool discovery tools (list_tools, grep_tools, get_tool_info)

  • All tools are still loaded in background for execute_tool to work

  • Prevents automatic exposure of all tools, reducing context window usage

  • Maintains full functionality through search and execute capabilities

  • Tool discovery tools enable progressive disclosure: start with minimal info, request details when needed

  • Agent-friendly features: simple text search (no regex required), natural language task discovery, combined search+detail tools to reduce tool call overhead

kwargs

传递给底层 FastMCP 服务器实例的附加参数。支持所有 FastMCP 配置选项以实现高级自定义。

Raises:

ImportError

如果未安装 FastMCP。FastMCP 是 SMCP 的必要依赖项。请使用以下命令安装:pip install fastmcp

注意事项:

  • SMCP automatically handles ToolUniverse tool loading and MCP conversion

  • Tool search uses ToolFinderLLM (optimized for cost) when available, gracefully falls back to simpler methods

  • All tools support JSON argument passing for maximum flexibility

  • Server supports graceful shutdown and comprehensive resource cleanup

  • Thread pool execution ensures non-blocking operation for concurrent requests

  • Built-in error handling provides informative debugging information

__init__(name=None, tooluniverse_config=None, tool_categories=None, exclude_tools=None, exclude_categories=None, include_tools=None, tools_file=None, tool_config_files=None, include_tool_types=None, exclude_tool_types=None, profile=None, workspace=None, use_global=False, auto_expose_tools=True, search_enabled=True, max_workers=5, hooks_enabled=False, hook_config=None, hook_type=None, compact_mode=False, **kwargs)[源代码]

Initialize with an optional sequence of providers.

参数:

providers – Optional initial providers (without namespacing). For namespaced providers, use add_provider() instead.

_load_profile_configs(profile)[源代码]

Load Profile configurations.

This method loads Profile configuration(s) and retrieves the LLM config and metadata from ToolUniverse. It completely reuses ToolUniverse’s load_profile functionality without reimplementing any logic.

参数:

profile (str | List[str]) – Profile URI or list of URIs (e.g., “./config.yaml”, “hf:user/repo”, or [“config1.yaml”, “config2.yaml”])

get_llm_config()[源代码]

Get the current Profile LLM configuration.

返回:

LLM configuration dictionary or None if not set

返回类型:

Dict[str, Any] | None

_register_custom_mcp_methods()[源代码]

Register custom MCP protocol methods for enhanced functionality.

This method extends the standard MCP protocol by registering custom handlers for scientific tool discovery and search operations, as well as MCP Tasks support for long-running operations.

Custom Methods Registered:

  • tools/find: AI-powered tool discovery using natural language queries

  • tools/search: Alternative endpoint for tool search (alias for tools/find)

  • tasks/get: Get current task status

  • tasks/list: List all tasks

  • tasks/cancel: Cancel a running task

  • tasks/result: Wait for task completion and get result

Implementation Details:

  • Uses FastMCP’s middleware system instead of request handler patching

  • Implements custom middleware methods for tools/find and tools/search

  • Adds MCP Tasks protocol support for long-running tool operations

  • Standard MCP methods (tools/list, tools/call) are handled by FastMCP

  • Implements proper error handling and JSON-RPC 2.0 compliance

注意事项:

This method is called automatically during SMCP initialization and should not be called manually.

async get_tools()[源代码]

Return registered tools as {name: Tool} dict (fastmcp 2/3 compat).

fastmcp 2 had get_tools() returning a dict; fastmcp 3 replaced it with list_tools() returning a list. This shim unifies both APIs.

_get_valid_categories()[源代码]

Get valid tool categories from ToolUniverse.

_load_tools_with_filters(tool_type=None)[源代码]

Load tools with the common set of filter parameters.

Centralizes the repeated pattern of calling load_tools with the same exclude/include/tools_file/config kwargs used across _setup_smcp_tools.

_ensure_compact_mode_categories()[源代码]

Load tool discovery categories required for compact mode.

_load_by_categories()[源代码]

Load tools for the requested categories with validation and fallback.

async _tools_find_middleware(context, call_next)[源代码]

Middleware for handling tools/find and tools/search requests.

This middleware intercepts tools/find and tools/search requests and provides AI-powered tool discovery functionality.

async _handle_tools_find(request_id, params)[源代码]

Handle the custom tools/find MCP method.

Searches for tools by natural language query and returns a JSON-RPC 2.0 response in either detailed (default) or mcp_standard format.

async _ensure_task_manager()[源代码]

Start the task manager if it has not been started yet.

async handle_tasks_get(task_id, auth_context=None)[源代码]

Get current task status.

async handle_tasks_list(auth_context=None, cursor=None)[源代码]

List all tasks.

async handle_tasks_cancel(task_id, auth_context=None)[源代码]

Cancel a running task.

async handle_tasks_result(task_id, auth_context=None, timeout=None)[源代码]

Wait for task completion and return its result.

Execute tool search using the most appropriate search method available.

Simplified unified interface that leverages the consistent tool interfaces. All search tools now return JSON format directly.

Parameters:

querystr

Natural language query describing the desired tool functionality

categorieslist of str, optional

Tool categories to filter results by

limitint

返回的工具最大数量

use_advanced_searchbool

Whether to prefer AI-powered search when available

search_methodstr, default ‘auto’

Specific search method: ‘auto’, ‘llm’, ‘embedding’, ‘keyword’

Returns:

str

JSON string containing search results

_select_search_tool(search_method, use_advanced_search)[源代码]

Select the appropriate search tool based on method and availability.

返回:

Tool name to use for search

返回类型:

str

_setup_smcp_tools()[源代码]

Initialize ToolUniverse tools, expose them as MCP tools, and set up search.

Handles: pre-loaded tool detection, category validation and loading with fallback, compact mode discovery categories, tool exposure to MCP, search initialization, and utility tool registration.

_expose_tooluniverse_tools()[源代码]

Convert and register loaded ToolUniverse tools as MCP-compatible tools.

Skips meta-tools (MCPAutoLoaderTool, MCPClientTool) and tracks already-exposed tools to prevent duplicates. Individual tool failures are logged but do not halt the process.

_expose_core_discovery_tools()[源代码]

Expose only core tool discovery tools in compact mode.

_add_search_tools()[源代码]

Register the find_tools MCP tool for AI-powered tool discovery.

Initializes the tool finder (ToolFinderLLM > Tool_RAG > keyword fallback) and registers a find_tools MCP tool that delegates to _perform_tool_search.

_init_tool_finder()[源代码]

Initialize the best available tool finder (LLM > RAG > keyword).

Sets self.tool_finder_available and self.tool_finder_type. Attempts to load the tool_finder category if no search tools are found among the already-loaded tools.

_add_utility_tools()[源代码]

Register utility tools (currently a no-op; execute_tool is a native ToolUniverse tool).

add_custom_tool(name, function, description=None, **kwargs)[源代码]

Add a custom Python function as an MCP tool.

参数:
  • name (str) – Unique tool name for the MCP interface.

  • function (Callable) – Sync or async callable to register.

  • description (str | None) – If provided, overrides the function’s docstring.

  • **kwargs – Additional FastMCP tool configuration options.

返回:

The decorated function registered with FastMCP.

_get_tool_annotations(tool_config)[源代码]

Get MCP tool annotations from tool config.

Annotations should already be computed and stored in tool_config[‘mcp_annotations’] during tool registration. This method simply retrieves them, with a fallback to compute them if they’re missing (for backward compatibility).

参数:

tool_config (dict) – Tool configuration dictionary

返回:

Dictionary with readOnlyHint and destructiveHint boolean values

返回类型:

dict

async close()[源代码]

Gracefully shut down the SMCP server, stopping the task manager and thread pool.

_print_tooluniverse_banner()[源代码]

Print ToolUniverse branding banner after FastMCP banner with dynamic information.

run(*args, **kwargs)[源代码]

重写运行方法以在FastMCP横幅之后显示ToolUniverse横幅。

此方法拦截父类的 run() 调用,以便在 FastMCP 显示其启动横幅后立即注入我们的自定义横幅。

run_simple(transport='http', host='0.0.0.0', port=7000, **kwargs)[源代码]

Start the SMCP server with the given transport.

参数:
  • transport (Literal['stdio', 'http', 'sse']) – Communication protocol - “stdio”, “http”, or “sse”.

  • host (str) – Bind address for HTTP/SSE transports.

  • port (int) – Port for HTTP/SSE transports.

  • **kwargs – Additional arguments passed to FastMCP’s run().

_SIMPLE_TYPE_MAP = {'array': <class 'list'>, 'boolean': typing.Union[bool, str], 'integer': typing.Union[int, str], 'number': typing.Union[float, str], 'object': <class 'dict'>, 'string': <class 'str'>}
static _resolve_oneof_type(param_info)[源代码]

Convert a JSON Schema oneOf spec to (python_type, field_kwargs_update).

返回:

(python_type, extra_field_kwargs) where extra_field_kwargs may contain json_schema_extra with the oneOf schema.

返回类型:

tuple

classmethod _resolve_param_type(param_info)[源代码]

Map a single JSON Schema parameter to (python_type, extra_field_kwargs).

Handles oneOf, simple types, array items cleanup, and nested object cleanup.

_create_mcp_tool_from_tooluniverse(tool_config, mcp_name=None)[源代码]

Create an MCP tool from a ToolUniverse tool configuration.

This method creates a function with proper parameter signatures that match the ToolUniverse tool schema, enabling FastMCP’s automatic parameter validation.

参数:
  • tool_config (Dict[str, Any]) – ToolUniverse tool configuration dictionary

  • mcp_name (str | None) – Optional shortened name for MCP exposure (if None, uses original name)

tooluniverse.create_smcp_server(name='SMCP Server', tool_categories=None, search_enabled=True, **kwargs)[源代码]

Create a configured SMCP server instance.

Convenience wrapper around SMCP(...) with sensible defaults.

参数:
  • name (str) – Human-readable server name.

  • tool_categories (List[str] | None) – ToolUniverse categories to load (None loads all).

  • search_enabled (bool) – Enable AI-powered tool discovery.

  • **kwargs – Additional SMCP / FastMCP configuration options.

返回:

Configured SMCP server instance ready to run.

返回类型:

SMCP

class tooluniverse.ToolUniverseClient[源代码]

基类:object

Standalone client that mirrors ALL ToolUniverse methods via HTTP.

Uses __getattr__ magic to dynamically proxy any method call to the server. When you call client.some_method(**kwargs), it makes an HTTP POST to the server with the method name and arguments.

Benefits: - No need to update client when ToolUniverse changes - Standalone (only needs ‘requests’, no ToolUniverse package) - Automatic method discovery - Identical API to local ToolUniverse

示例

client = ToolUniverseClient(”http://localhost:8080”)

# These all work automatically: client.load_tools(tool_type=[‘uniprot’, ‘ChEMBL’]) prompts = client.prepare_tool_prompts(tool_list, mode=”prompt”) result = client.run_one_function(function_call_json)

# Tomorrow you add a new method to ToolUniverse? # It automatically works: client.your_new_method(param=”value”)

__init__(base_url='http://localhost:8080')[源代码]

Initialize client.

参数:

base_url (str) – Base URL of ToolUniverse HTTP API server

_get_available_methods()[源代码]

Fetch list of available methods from server (cached)

__getattr__(method_name)[源代码]

Magic method that intercepts attribute access.

When you call client.some_method(**kwargs), Python: 1. Looks for ‘some_method’ attribute - doesn’t find it 2. Calls this __getattr__(“some_method”) 3. We return a function that makes HTTP call 4. That function gets called with your arguments 5. HTTP request sent to server with method name + args 6. Server calls tu.some_method(**kwargs) 7. Result returned to client

This means ANY ToolUniverse method works automatically! No need to define methods in this class.

list_available_methods()[源代码]

List all available ToolUniverse methods from the server.

返回:

  • name: Method name

  • parameters: List of parameter info

  • docstring: Method documentation

返回类型:

List of method information dicts with

示例

methods = client.list_available_methods() for m in methods:

print(f”{m[‘name’]}: {m[‘docstring’]}”)

help(method_name=None)[源代码]

Get help about available methods.

参数:

method_name (str | None) – Optional specific method to get help for. If None, lists all methods.

示例

client.help() # List all methods client.help(“load_tools”) # Help for specific method

reset_server(config=None)[源代码]

Reset the ToolUniverse instance on the server.

参数:

config (Dict[str, Any] | None) – Optional configuration for the new instance

示例

client.reset_server() # Reset with default config client.reset_server({“log_level”: “DEBUG”}) # With custom config

health_check()[源代码]

Check server health status.

返回:

Health status information

返回类型:

Dict[str, Any]

close()[源代码]

Close the HTTP session.

__enter__()[源代码]

Context manager entry.

__exit__(exc_type, exc_val, exc_tb)[源代码]

Context manager exit.

class tooluniverse.ProfileLoader[源代码]

基类:object

Simplified loader for ToolUniverse Profile configurations.

__init__(cache_dir=None)[源代码]

Initialize the Profile loader.

参数:

cache_dir (str | Path | None) – Directory for caching downloaded configurations

load(uri)[源代码]

Load Profile configuration from URI.

参数:

uri (str) – Profile URI (e.g., “hf:user/repo”, “./config.yaml”, “https://example.com/config.yaml”)

退货

Loaded configuration dictionary

抛出:

ValueError – If URI is unsupported or configuration is invalid

_load_from_hf(uri)[源代码]

Load configuration from HuggingFace Hub.

_load_from_url(uri)[源代码]

Load configuration from HTTP/HTTPS URL.

_load_from_file(file_path)[源代码]

Load configuration from local file.

_resolve_extends(config, _chain=None)[源代码]

Resolve the extends field by loading the base Profile and merging.

The base Profile is loaded first; the current config is then deep-merged on top so that every field in the current config overrides the base. The extends key itself is removed from the final result.

_chain tracks the URIs already being resolved in the current call stack and is used to detect circular references before they cause infinite recursion.

resolve_to_local_dir(uri)[源代码]

Resolve any URI to a local directory that contains Profile tool files.

Supported URI forms: - Local path (file or directory): returned as a Path (file → parent) - hf:user/repo: full repo downloaded via snapshot_download - https://github.com/user/repo[/tree/branch]: zip downloaded & extracted - Other http(s):// URL: single file downloaded; its parent dir returned

The result is always a Path to an existing directory.

_resolve_local_to_dir(uri)[源代码]

Return a local path as a directory (file → parent).

_resolve_hf_to_dir(uri)[源代码]

Download an entire HuggingFace repo and return its local path.

_resolve_github_to_dir(uri)[源代码]

Download a GitHub repo as a ZIP and extract it; return extracted dir.

_resolve_http_file_to_dir(uri)[源代码]

Download a single config file from an HTTP(S) URL into cache.

static get_tool_files_from_dir(dir_path)[源代码]

Scan dir_path for Python tool files and JSON config files.

Follows the same layout convention as _get_user_tool_files(): - Flat: *.py / *.json directly in the directory - Organised: tools/*.py and data/*.json / configs/*.json

profile.yaml / profile.json are excluded (handled separately). __init__.py is excluded (not a tool file).

返回:

(python_files, json_files) — both are lists of Path objects.

返回类型:

Tuple[List[Path], List[Path]]

_load_raw(uri)[源代码]

Load and parse a Profile URI without validation or extends resolution.

static _deep_merge(base, override)[源代码]

Recursively merge two dicts.

For keys present in both: dicts are merged recursively; all other types are replaced by the override value. Lists are replaced, not concatenated, so include_tools in the child fully replaces the parent list rather than extending it.

tooluniverse.validate_profile_config(config)[源代码]

Validate a Profile configuration using JSON Schema.

This is a legacy function that now uses the JSON Schema validation system. For new code, use validate_with_schema() instead.

参数:

config (Dict[str, Any]) – Configuration dictionary

返回:

Tuple of (is_valid, list_of_errors)

返回类型:

Tuple[bool, List[str]]

tooluniverse.validate_with_schema(yaml_content, fill_defaults_flag=True)[源代码]

Validate YAML content using JSON Schema and optionally fill default values.

参数:
  • yaml_content (str) – YAML content string

  • fill_defaults_flag (bool) – Whether to fill default values

返回:

Tuple of (is_valid, list_of_errors, processed_config)

返回类型:

Tuple[bool, List[str], Dict[str, Any]]

tooluniverse.validate_yaml_file_with_schema(file_path, fill_defaults_flag=True)[源代码]

Validate a YAML file using JSON Schema and optionally fill default values.

参数:
  • file_path (str) – Path to YAML file

  • fill_defaults_flag (bool) – Whether to fill default values

返回:

Tuple of (is_valid, list_of_errors, processed_config)

返回类型:

Tuple[bool, List[str], Dict[str, Any]]

tooluniverse.validate_yaml_format_by_template(yaml_content)[源代码]

Validate YAML format by comparing against default template format.

This method uses the JSON Schema as a reference to validate the structure and content of Profile YAML configurations.

参数:

yaml_content (str) – YAML content string

返回:

Tuple of (is_valid, list_of_errors)

返回类型:

Tuple[bool, List[str]]

class tooluniverse.ADAStandardsTool[源代码]

基类:BaseTool

American Diabetes Association (ADA) Standards of Care tools.

Supports three operations: - list_sections: List all sections of the current ADA Standards of Care - search: Search ADA guidelines by topic via PubMed - get_section: Fetch content of a specific ADA Standards section via PMC

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_list_sections(arguments)[源代码]

List all sections of the current ADA Standards of Care via PubMed.

Search ADA guidelines by topic using PubMed.

_get_section(arguments)[源代码]

Fetch content of a specific ADA Standards section via PMC.

class tooluniverse.ADMETAITool[源代码]

基类:BaseTool

用于预测给定SMILES字符串的ADMET属性的工具,基于admet-ai Python包。

__init__(**kwargs)[源代码]
_predict(smiles)[源代码]

Gets ADMET predictions for the given smiles

run(arguments)[源代码]

预测给定SMILES字符串的ADMET属性。

参数:

smiles – 分子的SMILES字符串。

退货

一个字典,将每个SMILES字符串映射到一个子字典,其中包含选定的ADMET属性及其预测值。

class tooluniverse.AHAACCGuidelineTool[源代码]

基类:BaseTool

American Heart Association (AHA) and American College of Cardiology (ACC) guideline tools. Uses PubMed to search and list clinical practice guidelines.

Supports three operations: - search: Search AHA/ACC guidelines by topic - list_aha: List recent AHA guidelines - list_acc: List recent ACC guidelines

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

Search AHA/ACC guidelines by topic.

_get_guideline(arguments)[源代码]

Fetch full text of an AHA/ACC guideline from PMC by PMID.

_list_org(arguments, org_name)[源代码]

List recent guidelines from a specific organization.

class tooluniverse.AOPWikiDetailTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.AOPWikiListTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.APPRISTool[源代码]

基类:BaseTool

Tool for APPRIS principal isoform annotation queries.

BASE_URL = 'https://apprisws.bioinfo.cnio.es/rest'
VALID_METHODS = {'appris', 'corsair', 'crash', 'firestar', 'matador3d', 'proteo', 'spade', 'thump', 'tsl'}
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_build_url(gene_id, species='homo_sapiens')[源代码]
_fetch(gene_id, species='homo_sapiens', methods=None)[源代码]
static _filter_principal_isoforms(records)[源代码]
_get_isoforms(arguments)[源代码]
_get_principal(arguments)[源代码]
_get_functional_annotations(arguments)[源代码]
class tooluniverse.ARCHS4Tool[源代码]

基类:BaseTool

Tool for querying the ARCHS4 gene expression database.

ARCHS4 provides uniformly processed RNA-seq data from GEO, covering 300K+ human and mouse samples with pre-computed expression levels and gene co-expression correlations.

Supported operations: - get_gene_expression: Get expression across tissues/cell lines for a gene - get_gene_correlations: Get co-expressed genes (Pearson correlation)

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_get_gene_expression(arguments)[源代码]

Get gene expression across tissues or cell lines from ARCHS4.

_get_gene_correlations(arguments)[源代码]

Get co-expressed genes for a query gene from ARCHS4.

class tooluniverse.AddgeneTool[源代码]

基类:BaseTool

Tool for querying the Addgene plasmid repository.

Addgene is a nonprofit global plasmid repository that archives and distributes plasmids for the scientific community. This tool provides access to: - Plasmid search (by name, gene, species, vector type, purpose) - Plasmid detail retrieval (cloning info, inserts, resistance markers) - Depositor/PI search

Requires API token via ADDGENE_API_KEY environment variable. Register at https://developers.addgene.org/ for access.

__init__(tool_config)[源代码]
_get_headers()[源代码]

Get request headers with auth token.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_plasmids(arguments)[源代码]

Search Addgene plasmid catalog.

Supports filtering by name, genes, species, vector_types, purpose, experimental_use, expression, and more.

_get_plasmid(arguments)[源代码]

Get detailed information about a specific plasmid.

Returns full plasmid record including cloning info, inserts, resistance markers, growth conditions, article, depositor comments.

_search_depositors(arguments)[源代码]

Search for depositors (PIs) by querying plasmids and extracting unique depositor information.

The Addgene API does not have a dedicated depositor search endpoint, so this searches plasmids filtered by PI name or institution, then extracts and deduplicates depositor info from results.

class tooluniverse.AgenticTool[源代码]

基类:BaseTool

围绕LLM提示的通用包装器,支持使用JSON定义的配置以及提示和输入参数。

STREAM_FLAG_KEY = '_tooluniverse_stream'
static has_any_api_keys()[源代码]

检查所有支持的 API 类型中是否有可用的 API 密钥。

退货

bool: True if at least one API type has all required keys, False otherwise

__init__(tool_config)[源代码]
_get_global_fallback_chain()[源代码]

从环境中获取全局回退链,或使用默认值。

_try_initialize_api()[源代码]

尝试初始化主API,若已配置则回退至次要API。

_try_api(api_type, model_id, server_url=None)[源代码]

尝试初始化特定的 API 和模型。

_validate_model_config()[源代码]
run(arguments, stream_callback=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

static _iter_chunks(text, size=800)[源代码]
_emit_stream_chunk(chunk, stream_callback)[源代码]
_validate_arguments(arguments)[源代码]
_format_prompt(arguments)[源代码]
get_prompt_preview(arguments)[源代码]
get_model_info()[源代码]
is_available()[源代码]

检查该工具是否可用。

get_availability_status()[源代码]

获取工具的详细可用性状态。

retry_initialization()[源代码]

尝试重新初始化工具(如果更新了API密钥,这将非常有用)。

get_prompt_template()[源代码]
get_input_arguments()[源代码]
validate_configuration()[源代码]
estimate_token_usage(arguments)[源代码]
class tooluniverse.AllenBrainTool[源代码]

基类:BaseTool

Tool for querying the Allen Brain Atlas REST API.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Allen Brain Atlas API call.

_make_rma_query(criteria, num_rows=50, start_row=0, include=None)[源代码]

Execute an RMA query against the Allen Brain Atlas API.

_search_genes(arguments)[源代码]

Search for genes by acronym or name.

_search_structures(arguments)[源代码]

Search for brain structures by acronym or name.

_get_expression_data(arguments)[源代码]

Get gene expression data sets for a gene.

_get_structure_by_id(arguments)[源代码]

Get a brain structure by its numeric ID.

class tooluniverse.AllianceGenomeTool[源代码]

基类:BaseTool

Tool for querying the Alliance of Genome Resources API.

Provides cross-species gene information across 7 model organisms (yeast, fly, worm, zebrafish, rat, mouse, frog) plus human. Supports gene detail, disease associations, phenotypes, and search.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Alliance of Genome Resources API call.

_query(arguments)[源代码]

Route to the appropriate Alliance endpoint.

static _normalize_gene_id(gene_id)[源代码]

Auto-add required namespace prefix if missing.

_get_gene_detail(arguments)[源代码]

Get detailed gene information from Alliance.

_search_genes(arguments, species_prefix='', species_name='')[源代码]

Search genes via Alliance autocomplete, optionally filtered to one species.

_search_genes_by_species(arguments, species_prefix, species_name)[源代码]
_get_gene_phenotypes(arguments)[源代码]

Get phenotype annotations for a gene.

_get_disease_genes(arguments)[源代码]

Get genes associated with a disease by Disease Ontology ID.

_get_disease_detail(arguments)[源代码]

Get disease summary information by Disease Ontology ID.

_get_gene_orthologs(arguments)[源代码]

Get ortholog genes across species for a given gene.

_get_gene_alleles(arguments)[源代码]

Get alleles and variants for a gene.

_get_gene_expression_summary(arguments)[源代码]

Get expression summary (ribbon) for a gene.

_get_gene_interactions(arguments)[源代码]

Get molecular or genetic interactions for a gene.

_get_gene_disease_models(arguments)[源代码]

Get disease models involving a gene.

_get_allele_detail(arguments)[源代码]

Get detailed information about a specific allele.

class tooluniverse.AlphaFoldRESTTool[源代码]

基类:BaseTool

AlphaFold Protein Structure Database API tool. Generic wrapper for AlphaFold API endpoints from alphafold_tools.json.

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]
_make_request(url)[源代码]

Perform a GET request and handle common errors.

run(arguments)[源代码]

使用提供的参数执行工具。

class tooluniverse.AlphaMissenseTool[源代码]

基类:BaseTool

Tool for querying AlphaMissense pathogenicity predictions.

AlphaMissense uses deep learning trained on evolutionary data to predict the pathogenicity of all possible single amino acid substitutions in human proteins.

Classification thresholds: - Pathogenic: score > 0.564 - Ambiguous: 0.34 <= score <= 0.564 - Benign: score < 0.34

No authentication required. Free for academic/research use.

PATHOGENIC_THRESHOLD = 0.564
BENIGN_THRESHOLD = 0.34
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the AlphaMissense API call.

_classify_score(score)[源代码]

Classify pathogenicity based on AlphaMissense thresholds.

_get_protein_scores(arguments)[源代码]

Get AlphaMissense scores for a protein by UniProt ID.

Note: The AlphaMissense API requires querying individual residue positions. This method demonstrates access to the data by sampling the first position. For complete protein-wide analysis, use get_residue_scores for each position.

_get_variant_score(arguments)[源代码]

Get AlphaMissense pathogenicity score for a specific variant.

Variant format: p.X123Y where X is reference amino acid, 123 is position, and Y is the variant amino acid.

_get_residue_scores(arguments)[源代码]

Get AlphaMissense scores for all possible substitutions at a specific residue.

Returns scores for all 20 amino acid substitutions at the given position.

class tooluniverse.ArXivPDFSnippetsTool[源代码]

基类:BaseTool

Fetch an arXiv paper’s PDF and return bounded text snippets around user-provided terms. Uses markitdown to convert PDF to markdown text.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.ArXivTool[源代码]

基类:BaseTool

使用公共 arXiv API 按关键词搜索 arXiv 论文。

__init__(tool_config, base_url='http://export.arxiv.org/api/query')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_VALID_SORT_BY = {'lastUpdatedDate', 'relevance', 'submittedDate'}
_build_search_query(query)[源代码]

Build arXiv search_query, joining multi-word queries with AND.

If the query already contains arXiv field prefixes (au:, ti:, cat:, abs:, etc.) or boolean operators (AND, OR, ANDNOT), pass it through as-is. Otherwise, split into tokens respecting quoted phrases and join with AND.

Special handling: single-prefix queries with multi-word unquoted values (e.g. ‘au:Shanghua Gao’) get auto-quoted (‘au:”Shanghua Gao”’) so the arXiv API treats the full name as the author field value.

_respect_rate_limit()[源代码]

arXiv asks clients to avoid rapid-fire requests; keep a 3s gap.

class tooluniverse.ArrayExpressRESTTool[源代码]

基类:BaseTool

ArrayExpress REST API tool - Original ArrayExpress Database.

Accesses the official ArrayExpress functional genomics database. ArrayExpress is the authoritative source for gene expression data, microarray experiments, and RNA-seq studies from EBI.

The database infrastructure uses BioStudies backend for improved performance and integration, but this tool specifically queries the ArrayExpress collection to maintain the original data source.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments (BioStudies API)

_build_params(args)[源代码]

Build query parameters for BioStudies API

run(arguments)[源代码]

Execute the BioStudies API call for ArrayExpress data

_extract_files_from_section(section)[源代码]

Extract files from a BioStudies section

_extract_samples_from_section(section)[源代码]

Extract sample information from a BioStudies section

class tooluniverse.BRENDATool[源代码]

基类:BaseTool

Tool for querying BRENDA enzyme database via SOAP API.

Supports Km, kcat, inhibitor, and general enzyme info queries. Requires BRENDA_EMAIL and BRENDA_PASSWORD environment variables. Register for free at https://www.brenda-enzymes.org/register.php

__init__(tool_config)[源代码]
_credentials()[源代码]
_auth_error()[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_get_km(arguments)[源代码]
_get_kcat(arguments)[源代码]
_get_inhibitors(arguments)[源代码]
_get_enzyme_info(arguments)[源代码]
_resolve_ec_from_name(enzyme_name)[源代码]

Resolve enzyme name to EC number via UniProt search.

_fetch_expasy_enzyme(ec_number)[源代码]

Fetch enzyme info from ExPASy ENZYME database (no auth).

_fetch_sabiork_kinetics(ec_number, organism='', limit=20)[源代码]

Fetch kinetic parameters from SABIO-RK (no auth).

Reuses shared parsing from sabiork_tool module.

_get_enzyme_kinetics(arguments)[源代码]

Retrieve comprehensive enzyme kinetics WITHOUT requiring BRENDA credentials.

Uses ExPASy ENZYME for enzyme info + SABIO-RK for kinetic parameters. If BRENDA credentials are set, adds BRENDA data as enhancement.

class tooluniverse.BVBRCTool[源代码]

基类:BaseTool

Tool for querying the BV-BRC pathogen genomics database.

BV-BRC provides comprehensive pathogen genome data including genome metadata, antimicrobial resistance phenotypes, and annotated genome features. Covers bacteria and viruses with rich AMR surveillance data.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the BV-BRC API call.

_query(arguments)[源代码]

Route to appropriate query method.

_build_query_string(conditions, limit=25, select_fields=None)[源代码]

Build BV-BRC SOLR-like query string.

_make_request(endpoint, query)[源代码]

Make a request to BV-BRC API.

_get_genome(arguments)[源代码]

Get a specific genome by ID.

_search_genomes(arguments)[源代码]

Search for genomes by keyword.

_search_amr(arguments)[源代码]

Search for antimicrobial resistance data.

_search_features(arguments)[源代码]

Search for genome features (genes, CDS).

_search_epitopes(arguments)[源代码]

Search for pathogen epitopes (B-cell and T-cell).

_search_surveillance(arguments)[源代码]

Search influenza/pathogen surveillance data.

_search_specialty_genes(arguments)[源代码]

Search for specialty genes (virulence factors, AMR genes, drug targets).

_get_protein_structure(arguments)[源代码]

Get a specific protein structure by PDB ID.

_search_protein_structures(arguments)[源代码]

Search for pathogen protein structures.

_get_taxonomy(arguments)[源代码]

Get taxonomy details by taxon ID.

_search_taxonomy(arguments)[源代码]

Search pathogen taxonomy.

_search_pathways(arguments)[源代码]

Search for metabolic pathways in pathogen genomes.

_search_subsystems(arguments)[源代码]

Search for functional subsystems in pathogen genomes.

class tooluniverse.BaseMCPClient[源代码]

基类:object

Base MCP client with common functionality shared between MCPClientTool and MCPAutoLoaderTool. Provides session management, request handling, and async cleanup patterns.

__init__(server_url, transport='http', timeout=30)[源代码]
async _close_session()[源代码]

Placeholder for compatibility; HTTP client calls are scoped per request.

_get_mcp_endpoint(path)[源代码]

Get the full MCP endpoint URL

async _make_mcp_request(method, params=None)[源代码]

Make an MCP JSON-RPC request

_run_with_cleanup(async_func)[源代码]

Common async execution pattern with proper cleanup

class tooluniverse.BasePythonExecutor[源代码]

基类:object

Base class for Python execution tools with shared security features.

SAFE_BUILTINS = {'__import__', 'abs', 'all', 'any', 'bool', 'callable', 'dict', 'enumerate', 'filter', 'float', 'getattr', 'hasattr', 'int', 'isinstance', 'len', 'list', 'map', 'max', 'min', 'print', 'range', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'str', 'sum', 'tuple', 'type', 'zip'}
DEFAULT_ALLOWED_MODULES = {'collections', 'dataclasses', 'datetime', 'decimal', 'fractions', 'itertools', 'json', 'math', 'matplotlib', 'numpy', 'random', 're', 'scipy', 'statistics', 'sympy', 'typing'}
FORBIDDEN_AST_NODES = {'Attribute': ['__import__', 'open', 'file'], 'Call': ['open', 'eval', 'exec', 'compile', '__import__', 'input', 'raw_input'], 'Import': ['os', 'sys', 'subprocess', 'socket', 'urllib', 'requests', 'http']}
__init__(tool_config)[源代码]

Initialize the executor with tool configuration.

_check_ast_safety(code)[源代码]

Check code AST for dangerous operations.

返回:

(is_safe, warnings)

返回类型:

tuple[bool, List[str]]

_create_safe_globals(additional_vars=None)[源代码]

Create a safe globals dictionary with restricted builtins.

_capture_output(func, *args, **kwargs)[源代码]

Capture stdout and stderr during function execution.

_handle_timeout(signum, frame)[源代码]

Handle execution timeout.

_execute_with_timeout(func, timeout_seconds, *args, **kwargs)[源代码]

Execute function with timeout using signal or threading.

_format_error_response(error, error_type, stdout='', stderr='', execution_time=0)[源代码]

Format error response with detailed information.

_format_success_response(result, stdout, stderr, execution_time, code_lines=0, ast_warnings=None)[源代码]

Format success response with execution details.

_get_package_to_install(package)[源代码]

Get the actual package name to install (parent package for submodules)

_check_and_install_dependencies(dependencies, auto_install=False, require_confirmation=True)[源代码]

Check and optionally install missing dependencies with user confirmation.

class tooluniverse.BaseRESTTool[源代码]

基类:BaseTool

Base class for REST API tools with common HTTP request handling.

Provides reusable methods for: - Building URLs with path parameters (e.g., {id}, {doi}) - Constructing query parameters - Making HTTP requests with retry logic - Standard error handling and response formatting

Subclasses should override: - _get_param_mapping() - to customize parameter name mappings - _process_response() - to customize response processing - _handle_special_endpoint() - for endpoint-specific logic

__init__(tool_config)[源代码]
_get_param_mapping()[源代码]

Get parameter name mappings from argument names to API parameter names.

Override this in subclasses to provide custom mappings. Example: {“limit”: “rows”, “query”: “q”}

_build_url(args)[源代码]

Build URL by replacing path parameters like {id}, {doi}, {accession}.

参数:

args (Dict[str, Any]) – Tool arguments dictionary

返回:

Complete URL with path parameters substituted

返回类型:

str

_build_params(args)[源代码]

Build query parameters from arguments.

参数:

args (Dict[str, Any]) – Tool arguments dictionary

返回:

Query parameters dictionary

返回类型:

Dict[str, Any]

_process_response(response, url)[源代码]

Process successful API response.

Override this in subclasses for API-specific response handling.

参数:
  • response (Response) – HTTP response object

  • url (str) – Request URL

返回:

Processed response dictionary

返回类型:

Dict[str, Any]

_handle_special_endpoint(url, response, arguments)[源代码]

Handle special endpoints that need custom processing.

Override this for endpoint-specific logic (e.g., download endpoints). Return None to use default processing.

参数:
  • url (str) – Request URL

  • response (Response) – HTTP response object

  • arguments (Dict[str, Any]) – Original arguments

返回:

Custom result dictionary or None for default processing

返回类型:

Dict[str, Any] | None

run(arguments)[源代码]

Execute the API request.

参数:

arguments (Dict[str, Any]) – Tool arguments dictionary

返回:

Result dictionary with status, data, url, and optional error info

返回类型:

Dict[str, Any]

class tooluniverse.BgeeTool[源代码]

基类:BaseTool

Tool for querying the Bgee gene expression database.

Bgee integrates expression data from multiple data types (RNA-Seq, Affymetrix, EST, in situ hybridization) and provides curated present/absent expression calls across tissues and developmental stages.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Bgee API call.

_query(arguments)[源代码]

Route to appropriate Bgee endpoint.

Search for genes by name or symbol across species.

_gene_expression(arguments)[源代码]

Get expression data for a gene across tissues/organs.

_species_list(arguments)[源代码]

List all species available in Bgee.

class tooluniverse.BiGGModelsTool[源代码]

基类:BaseTool

BiGG Models API tool for metabolic modeling.

Provides access to: - Genome-scale metabolic models (85+ organisms) - Reactions, metabolites, and genes - Universal reaction/metabolite databases - Model downloads in multiple formats

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the BiGG Models API tool.

_list_models(arguments)[源代码]

List all available metabolic models.

_get_model(arguments)[源代码]

Get details for a specific model.

_get_model_reactions(arguments)[源代码]

Get reactions in a model.

_get_model_metabolites(arguments)[源代码]

Get metabolites in a model.

_get_model_genes(arguments)[源代码]

Get genes in a model.

_get_reaction(arguments)[源代码]

Get reaction details.

_get_metabolite(arguments)[源代码]

Get metabolite details.

_get_gene(arguments)[源代码]

Get gene details from a model.

Search BiGG database.

_get_database_version(arguments)[源代码]

Get BiGG database version information.

class tooluniverse.BinaryDownloadTool[源代码]

基类:BaseTool

Download binary files with chunked streaming.

Optimized for large binary files like images, videos, executables. Supports chunked downloads for better memory management.

Expects: {“url”: “https://…”, “output_path”: “/path/to/save”} Optional: {“chunk_size”: bytes, “timeout”: seconds} Returns: {“file_path”: “…”, “size”: bytes, “content_type”: “…”}

__init__(tool_config)[源代码]
run(arguments)[源代码]

Download binary file from URL.

参数:

arguments (Dict[str, Any]) – Dictionary containing url and optional parameters

返回:

Dictionary with file_path and metadata, or error

返回类型:

Dict[str, Any]

class tooluniverse.BindingDBTool[源代码]

基类:BaseTool

Tool for querying BindingDB binding affinity database.

BASE_URL = 'https://www.bindingdb.org/rest'
__init__(tool_config)[源代码]
_BROKEN_MSG = 'BindingDB REST API is currently unavailable (requests time out). Use ChEMBL (ChEMBL_get_target_activities) or PubChem BioAssay for binding affinity data.'
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.BioGRIDRESTTool[源代码]

基类:BaseTool

BioGRID Database REST API tool. Generic wrapper for BioGRID API endpoints defined in ppi_tools.json.

__init__(tool_config)[源代码]
_build_url()[源代码]

Build URL for BioGRID API request.

_ORGANISM_MAP = {'homo sapiens': 9606, 'mus musculus': 10090, 'saccharomyces cerevisiae': 559292}
_LIST_PARAM_MAP = {'chemical_names': 'chemicalList', 'evidence_types': 'evidenceList', 'gene_names': 'geneList', 'ptm_type': 'ptmType', 'pubmed_ids': 'pubmedList'}
_build_params(arguments)[源代码]

Build parameters for BioGRID API request.

_make_request(url, params)[源代码]

Perform a GET request and handle common errors.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.BioImageArchiveTool[源代码]

基类:BaseTool

Tool for querying the BioImage Archive at EBI.

Provides access to biological imaging datasets including fluorescence microscopy, cryo-EM, confocal imaging, and other life sciences imaging modalities. Supports searching studies and retrieving detailed metadata.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the BioImage Archive API call.

_query(arguments)[源代码]

Route to appropriate query method.

Search for biological imaging studies.

_get_study(arguments)[源代码]

Get detailed information about a specific study.

_search_bioimages(arguments)[源代码]

Search the BioImages-specific collection.

class tooluniverse.BioModelsRESTTool[源代码]

基类:BaseRESTTool

Generic REST tool for BioModels API endpoints.

_get_param_mapping()[源代码]

Map BioModels-specific parameter names.

_handle_special_endpoint(url, response, arguments)[源代码]

Handle download endpoints specially.

_process_response(response, url)[源代码]

Process BioModels API response.

class tooluniverse.BioPortalTool[源代码]

基类:BaseTool

Tool for querying BioPortal, the largest biomedical ontology repository.

BioPortal hosts 900+ ontologies covering diseases (DOID, MONDO), phenotypes (HPO), gene function (GO), chemicals (CHEBI), anatomy (UBERON), drugs (RXNORM), and more.

Supports: cross-ontology search, concept detail lookup, text annotation with ontology terms, and concept hierarchy traversal.

Uses public demo API key (no registration required).

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the BioPortal API call.

_query(arguments)[源代码]

Route to appropriate BioPortal endpoint.

Search across all (or specific) ontologies for terms.

_get_concept(arguments)[源代码]

Get detailed information for a specific ontology concept.

_annotate_text(arguments)[源代码]

Annotate biomedical text with ontology terms (named entity recognition).

_get_hierarchy(arguments)[源代码]

Get children or ancestors of an ontology concept.

class tooluniverse.BioRxivTool[源代码]

基类:BaseTool

Get bioRxiv or medRxiv preprint metadata by DOI.

This tool retrieves full metadata for a specific preprint using the bioRxiv API. For searching preprints by keywords, use EuropePMC_search_articles with ‘SRC:PPR’ filter instead.

参数:
  • doi (str) – bioRxiv or medRxiv DOI (e.g., ‘10.1101/2023.12.01.569554’ or ‘2023.12.01.569554’)

  • server (str) – Server name - ‘biorxiv’ or ‘medrxiv’ (default: ‘biorxiv’)

__init__(tool_config, base_url='https://api.biorxiv.org/details')[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.BioSamplesTool[源代码]

基类:BaseTool

Tool for querying EBI BioSamples database.

Provides access to biological sample metadata including organism, tissue type, disease state, and links to associated data archives.

No authentication required for read access.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the BioSamples API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_get_sample(arguments)[源代码]

Get a specific biological sample by accession.

Search BioSamples by text query.

_search_by_filter(arguments)[源代码]

Search BioSamples with attribute filters.

class tooluniverse.BioStudiesRESTTool[源代码]

基类:BaseTool

BioStudies REST API tool.

BioStudies is a general-purpose repository for biological studies at EMBL-EBI. It provides access to diverse study types including genomics, transcriptomics, proteomics, imaging, and more.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from arguments

_build_params(args)[源代码]

Build query parameters for BioStudies API

_convert_html_to_markdown(html_content, url)[源代码]

Convert HTML content to Markdown using markitdown

run(arguments)[源代码]

Execute the BioStudies API call

_extract_files(data)[源代码]

Extract file list from BioStudies response

_extract_files_from_section(section)[源代码]

Extract files from a BioStudies section (recursive)

class tooluniverse.BioregistryTool[源代码]

基类:BaseTool

Tool for querying the Bioregistry meta-registry.

Provides: - Identifier resolution across 2600+ databases - Registry metadata (prefix, name, pattern, providers) - Search across all registered resources

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute Bioregistry API call based on operation type.

_resolve_reference(arguments)[源代码]

Resolve a compact identifier (prefix:id) to provider URLs.

_get_registry(arguments)[源代码]

Get metadata for a specific registry/database by prefix.

_search_registries(arguments)[源代码]

Search across all registered resources.

class tooluniverse.Boltz2DockingTool[源代码]

基类:BaseTool

Tool to perform protein-ligand docking and affinity prediction using the local Boltz-2 model. This tool constructs a YAML input file, runs the boltz predict command, and parses the output to return the predicted structure and affinity.

__init__(tool_config)[源代码]

Initializes the BoltzDockingTool. Checks if the ‘boltz’ command is available in the system’s PATH.

_build_yaml_input(arguments)[源代码]

Constructs the YAML data structure for the Boltz input.

run(arguments=None, timeout=1200)[源代码]

Executes the Boltz prediction.

参数:
  • arguments (dict) – A dictionary containing the necessary inputs. - protein_sequence (str): The amino acid sequence of the protein. - ligands (list[dict]): A list of ligands, each with a ‘smiles’ or ‘ccd’ key. - constraints (list[dict], optional): Covalent bonds or other constraints. - templates (list[dict], optional): Structural templates. - other optional boltz CLI flags (e.g., ‘recycling_steps’).

  • timeout (int) – The maximum time in seconds to wait for the Boltz command to complete.

退货

dict: A dictionary containing the path to the predicted structure and affinity data, or an error.

class tooluniverse.BridgeDbTool[源代码]

基类:BaseTool

Tool for mapping biological identifiers across databases using BridgeDb.

BridgeDb provides cross-reference lookups for genes, proteins, metabolites, and other biological entities across 45+ databases including HMDB, ChEBI, KEGG, PubChem, Ensembl, UniProt, and HGNC.

Supported operations: - xrefs: Get all cross-references for an identifier - search: Search for identifiers by name - attributes: Get properties/attributes of an identifier

__init__(tool_config)[源代码]
_infer_operation(arguments)[源代码]

Infer operation from tool name when not explicitly provided.

run(arguments)[源代码]

Execute the BridgeDb API tool with given arguments.

_resolve_system_code(source)[源代码]

Resolve a database name or system code to a BridgeDb system code.

_parse_tsv_xrefs(text)[源代码]

Parse tab-separated cross-reference data into structured list.

_parse_tsv_attributes(text)[源代码]

Parse tab-separated attribute data into structured dict.

_get_xrefs(arguments)[源代码]

Get cross-references for an identifier.

Search for identifiers by name.

_get_attributes(arguments)[源代码]

Get attributes/properties for an identifier.

class tooluniverse.CADDTool[源代码]

基类:BaseTool

Tool for querying CADD API for variant deleteriousness scores.

CADD integrates diverse annotations into a single metric (PHRED score) by contrasting variants that survived natural selection with simulated mutations.

PHRED score interpretation: - >= 10: Top 10% most deleterious (likely damaging) - >= 20: Top 1% most deleterious (damaging) - >= 30: Top 0.1% most deleterious (highly damaging) - Common pathogenic threshold: 15-20

Supported genome builds: GRCh37, GRCh38 Current version: v1.7

No authentication required. API is experimental.

DEFAULT_VERSION = 'GRCh38-v1.7'
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the CADD API call.

_interpret_phred(phred)[源代码]

Interpret PHRED score for user-friendly output.

_get_variant_score(arguments)[源代码]

Get CADD score for a specific SNV.

Query format: chrom:pos_ref_alt (e.g., 7:140453136_A_T for BRAF V600E)

_get_position_scores(arguments)[源代码]

Get CADD scores for all possible SNVs at a genomic position.

Returns scores for A, C, G, T substitutions at the given position.

_get_range_scores(arguments)[源代码]

Get CADD scores for a genomic range (max 100bp).

Returns all pre-computed scores in the specified range.

class tooluniverse.CATHTool[源代码]

基类:BaseTool

Tool for querying the CATH protein structure classification database.

CATH classifies protein domain structures into a hierarchy: Class -> Architecture -> Topology -> Homologous superfamily. Covers 500,000+ domains from PDB and AFDB structures.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the CATH API call.

_query(arguments)[源代码]

Route to appropriate CATH endpoint.

_get_superfamily(arguments)[源代码]

Get CATH superfamily information by CATH ID.

_get_domain_summary(arguments)[源代码]

Get domain summary for a CATH domain ID (PDB chain domain).

_list_funfams(arguments)[源代码]

List functional families (FunFams) within a CATH superfamily.

_get_funfam(arguments)[源代码]

Get details for a specific FunFam within a CATH superfamily.

class tooluniverse.CBioPortalRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]
_get_gene_entrez_ids(gene_symbols)[源代码]

Convert gene symbols to Entrez IDs

_get_mutation_profile_id(study_id)[源代码]

Get the mutation molecular profile ID for a study

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.CDCRESTTool[源代码]

基类:BaseTool

CDC Data.CDC.gov REST API tool (Socrata-based open data portal).

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]

Build the full CDC Data API URL with path parameters and query string.

_make_request(arguments)[源代码]

Make HTTP request to CDC Data API.

run(arguments)[源代码]

Execute the CDC Data tool.

class tooluniverse.CELLxGENECensusTool[源代码]

基类:BaseTool

CELLxGENE Census API tool for accessing single-cell RNA-seq data. Provides access to cell metadata, gene expression, and embeddings.

run(arguments)[源代码]

Execute the tool with given arguments.

_get_census_versions()[源代码]

Get list of available Census versions.

_get_obs_metadata(arguments, census_version)[源代码]

Get observation (cell) metadata.

_get_var_metadata(arguments, census_version)[源代码]

Get variable (gene) metadata.

_get_anndata(arguments, census_version)[源代码]

Get expression data as AnnData object summary.

_get_presence_matrix(arguments, census_version)[源代码]

Get feature presence matrix.

_get_embeddings(arguments, census_version)[源代码]

Get pre-calculated embeddings.

_download_h5ad(arguments, census_version)[源代码]

Download source H5AD file.

class tooluniverse.CIViCTool[源代码]

基类:BaseTool

Tool for querying CIViC (Clinical Interpretation of Variants in Cancer).

CIViC provides: - Expert-curated cancer variant interpretations - Clinical evidence levels - Drug-variant associations - Disease-variant associations

Uses GraphQL API. No authentication required. Free for academic/research use.

__init__(tool_config)[源代码]
_build_graphql_query(arguments)[源代码]

Build GraphQL query from template and arguments.

_lookup_gene_id(gene_name)[源代码]

Look up CIViC gene ID by gene symbol via GraphQL.

_get_variants_for_gene_id(gene_id, limit=500)[源代码]

Fetch variants for a given CIViC gene_id via GraphQL.

Feature-45A-01: CIViC API caps variants(first:) at 100 server-side. Use cursor-based pagination to fetch all variants up to limit.

run(arguments)[源代码]

Execute the CIViC GraphQL API call.

class tooluniverse.CMAGuidelinesTool[源代码]

基类:BaseTool

Canadian clinical practice guidelines search tool. Searches PubMed for Canadian clinical practice guidelines published by Canadian healthcare organizations including CMA, Canadian Task Force, and others.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_cma_guidelines(query, limit)[源代码]

Search Canadian clinical guidelines via PubMed.

_extract_guideline_content(url)[源代码]

Extract actual content from a guideline URL.

class tooluniverse.CODTool[源代码]

基类:BaseRESTTool

Tool for querying the Crystallography Open Database (COD).

Adds user-friendly aliases and client-side result limiting: - query -> text - spacegroup -> sg - cod_id -> id - max_results / results -> client-side truncation

run(arguments)[源代码]

Execute the API request.

参数:

arguments (Dict[str, Any]) – Tool arguments dictionary

返回:

Result dictionary with status, data, url, and optional error info

返回类型:

Dict[str, Any]

class tooluniverse.COSMICTool[源代码]

基类:BaseTool

Tool for querying COSMIC (Catalogue of Somatic Mutations in Cancer).

COSMIC provides: - Somatic mutation data in human cancers - Gene-level mutation information - Mutation coordinates and amino acid changes - Associated cancer types

Uses NLM Clinical Tables API. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the COSMIC API call based on operation type.

_search_mutations(arguments)[源代码]

Search COSMIC for mutations by term.

参数:

arguments (Dict[str, Any]) – Dict containing: - terms: Search query (gene name, mutation, etc.) - max_results: Maximum results to return (default 20, max 500) - genome_build: Genome build version (37 or 38, default 37)

_get_mutations_by_gene(arguments)[源代码]

Get all mutations for a specific gene.

参数:

arguments (Dict[str, Any]) – Dict containing: - gene: Gene symbol (e.g., BRAF, TP53) - max_results: Maximum results (default 100, max 500) - genome_build: Genome build version (37 or 38)

class tooluniverse.CPICGetRecommendationsTool[源代码]

基类:BaseTool

Get CPIC dosing recommendations by guideline_id, or auto-resolve from drug name.

Accepts either a numeric guideline_id directly, or a drug name that is resolved to a guideline_id via the CPIC /drug endpoint.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.CPICListGuidelinesTool[源代码]

基类:BaseTool

List CPIC pharmacogenomic guidelines with optional gene-symbol filtering.

Fetches all guidelines and optionally filters client-side by gene symbol, since the CPIC /guideline endpoint does not support server-side gene filtering.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.CPICSearchPairsTool[源代码]

基类:BaseRESTTool

Search CPIC gene-drug pairs with automatic PostgREST operator normalization.

Accepts plain gene symbols and CPIC levels (e.g., ‘CYP2D6’, ‘A’) and auto-prepends the required ‘eq.’ PostgREST operator so users do not need to know the PostgREST filter syntax.

_FILTER_PARAMS = ('genesymbol', 'cpiclevel')
_resolve_aliases(args)[源代码]

Resolve gene_symbol/gene aliases to genesymbol.

_build_params(args)[源代码]

Build query parameters from arguments.

参数:

args (Dict[str, Any]) – Tool arguments dictionary

返回:

Query parameters dictionary

返回类型:

Dict[str, Any]

_build_url(args)[源代码]

Build URL by replacing path parameters like {id}, {doi}, {accession}.

参数:

args (Dict[str, Any]) – Tool arguments dictionary

返回:

Complete URL with path parameters substituted

返回类型:

str

class tooluniverse.CTDTool[源代码]

基类:BaseTool

Tool for querying the Comparative Toxicogenomics Database (CTD).

CTD curates chemical-gene, chemical-disease, and gene-disease relationships from peer-reviewed literature. Supports queries by chemical names, gene symbols, disease names, or their standard identifiers.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the CTD batch query API call.

_query(arguments)[源代码]

Execute a CTD batch query and return structured results.

class tooluniverse.CTFPHCListGuidelinesTool[源代码]

基类:BaseTool

List all published guidelines from the Canadian Task Force on Preventive Health Care (CTFPHC). Fetches the official published-guidelines index page and returns title, URL, and year for each guideline.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.CTFPHCSearchGuidelinesTool[源代码]

基类:BaseTool

Search published guidelines from the Canadian Task Force on Preventive Health Care (CTFPHC) by keyword. Fetches the official index and filters client-side by title match.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.CTGovAPITool[源代码]

基类:BaseRESTTool

Tool for querying the ClinicalTrials.gov API v2.

Provides access to 572,000+ clinical trial records including: - Study protocol information (design, eligibility, interventions) - Recruitment status and enrollment data - Results and outcome measures - Sponsor and contact information

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the ClinicalTrials.gov API call.

_query(arguments)[源代码]

Route to the appropriate endpoint.

_search_studies(arguments)[源代码]

Search for clinical trials with various filters.

_get_study(arguments)[源代码]

Get full details for a single study by NCT ID.

_get_stats_size()[源代码]

Get aggregate statistics about the ClinicalTrials.gov database.

_get_field_values(arguments)[源代码]

Get value distribution for a specific field across studies.

class tooluniverse.CancerPrognosisTool[源代码]

基类:BaseTool

Cancer prognosis data retrieval from cBioPortal.

Queries the cBioPortal REST API for survival clinical data, gene expression values, and study information. Provides raw data that can be used with local Survival Analysis tools for custom Kaplan-Meier, log-rank, and Cox regression analyses.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_resolve_study(cancer_or_study)[源代码]

Resolve TCGA abbreviation or study ID to a cBioPortal study ID.

_api_get(path, params=None, timeout=30)[源代码]

GET request to cBioPortal API with retry.

_api_post(path, json_data, params=None, timeout=60)[源代码]

POST request to cBioPortal API with retry.

_get_expression_units(profile_id, profile_name=None)[源代码]

Feature-49A-M1: Infer expression data type/units from the cBioPortal profile. Feature-54A-002: Prefer the actual profile name from the API (e.g., ‘mRNA expression (log2 RNA Seq RPKM)’) over ID-based inference, since some studies use misleading ID suffixes (e.g., aml_ohsu_2022 uses _rna_seq_v2_mrna but stores log2 RPKM).

_get_mrna_profile(study_id)[源代码]

Find the best mRNA expression profile for a study. Returns (profile_id, profile_name) tuple, or None if not found. Feature-54A-002: also return the human-readable profile name so _get_expression_units can use the actual description instead of inferring from the profile ID string.

_get_gene_entrez_id(symbol)[源代码]

Resolve gene symbol to Entrez ID.

_get_survival_data(arguments)[源代码]

Retrieve OS and DFS survival clinical data for a study.

_get_gene_expression(arguments)[源代码]

Fetch gene expression values across samples in a study.

_search_studies(arguments)[源代码]

Search cBioPortal studies by keyword.

_get_study_summary(arguments)[源代码]

Get summary statistics for a cancer study.

class tooluniverse.CancerVarTool[源代码]

基类:BaseTool

CancerVar: AMP/ASCO/CAP 2017 somatic variant interpretation tool.

Classifies somatic cancer variants into four tiers per the AMP/ASCO/CAP 2017 guidelines: Tier I (strong clinical significance), Tier II (potential clinical significance), Tier III (unknown significance), Tier IV (benign/likely benign).

Returns all 12 CBP criteria scores, the tier assignment, and the Oncogenicity Pathogenicity Index (OPAI, 0–1).

Input: genomic coordinates (chr, pos, ref, alt) in hg19 or hg38. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_classify_variant(arguments)[源代码]
class tooluniverse.CellMarkerTool[源代码]

基类:BaseTool

Tool for querying the CellMarker 2.0 cell type marker database.

CellMarker 2.0 provides curated marker genes for hundreds of cell types across tissues in human and mouse, sourced from single-cell RNA-seq studies, experiments, reviews, and commercial antibody panels.

Supported operations: - search_by_gene: Find cell types that express a given marker gene - search_by_cell_type: Find marker genes for a specific cell type - list_cell_types: List available cell types in a tissue - search_cancer_markers: Search cancer-specific cell markers

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the CellMarker tool with given arguments.

_search_by_gene(arguments)[源代码]

Find cell types that express a given marker gene.

Uses Marker_table.jsp with POST: markerSpecies + markerMarker params. Returns HTML table rows parsed into structured data.

_search_by_cell_type(arguments)[源代码]

Find marker genes for a specific cell type.

Uses Marker_table.jsp with quickkeyword + quick_v=yes for general search, then filters results to match the target cell type.

_list_cell_types(arguments)[源代码]

List available cell types in a tissue.

Uses the CONTROL endpoint which returns a JavaScript array of cell types for a given tissue and species combination.

_search_cancer_markers(arguments)[源代码]

Search cancer-specific cell markers.

Searches for markers in cancer cell contexts. Can filter by: - cancer_type (tissue where cancer occurs, e.g., “Breast”, “Lung”) - gene_symbol (specific marker gene) - cell_type (specific cancer cell type)

Uses Marker_table.jsp with markerSpecies/markerMarker for gene-based search, or quickkeyword search for cell type / cancer type searches.

class tooluniverse.CellPaintingTool[源代码]

基类:BaseTool

Tool for querying Cell Painting datasets hosted on the Image Data Resource (IDR).

Provides access to: - Available Cell Painting screens (studies) - Plates within a screen - Well-level metadata and image links for a plate

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Cell Painting IDR tool with given arguments.

_make_request(path, params=None)[源代码]

Make a GET request to the IDR API.

_search_screens(arguments)[源代码]

List available Cell Painting screens in IDR, optionally filtered by keyword.

_get_screen_plates(arguments)[源代码]

Get plates belonging to a given screen.

_get_well_data(arguments)[源代码]

Get well-level metadata and image links for a plate.

class tooluniverse.CellosaurusGetCellLineInfoTool[源代码]

基类:BaseTool

用于通过细胞系的登录号获取详细信息的工具。

__init__(tool_config, base_url='https://api.cellosaurus.org')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_get_cell_line_info(accession, format_type, fields)[源代码]

Get detailed cell line information by accession number.

class tooluniverse.CellosaurusQueryConverterTool[源代码]

基类:BaseTool

用于将自然语言查询转换为适用于Cellosaurus API的Solr语法的工具。

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_calculate_similarity(term, text)[源代码]

Calculate similarity between a term and text using SequenceMatcher.

_map_term_to_field(term)[源代码]

Map a natural language term to Cellosaurus fields based on semantic similarity.

_extract_field_terms(query)[源代码]

Extract field-specific terms from the query using semantic mapping.

_apply_boolean_operators(query)[源代码]

Convert natural language boolean operators to Solr syntax.

_apply_range_queries(query)[源代码]

Convert natural language ranges to Solr range syntax.

_apply_wildcards(query)[源代码]

Convert natural language wildcard patterns to Solr syntax.

_construct_solr_query(terms, original_query)[源代码]

Construct the final Solr query from extracted terms.

_validate_solr_query(query)[源代码]

Basic validation of Solr query syntax.

_convert_query(natural_query, include_explanation=True)[源代码]

Convert natural language query to Solr syntax using systematic field mapping.

class tooluniverse.CellosaurusSearchTool[源代码]

基类:BaseTool

使用官方API搜索Cellosaurus细胞系的工具。

__init__(tool_config, base_url='https://api.cellosaurus.org')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_cell_lines(query, offset, size)[源代码]

Search Cellosaurus cell lines using the /search/cell-line endpoint.

class tooluniverse.CellxGeneDiscoveryTool[源代码]

基类:BaseTool

Tool for CZI CellxGene Discovery API providing access to single-cell RNA-seq datasets and curated collections.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the CellxGene Discovery API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_list_collections(arguments)[源代码]

List curated single-cell collections.

_get_collection(arguments)[源代码]

Get detailed collection information with datasets.

_search_datasets(arguments)[源代码]

Search single-cell datasets by tissue, disease, or organism.

class tooluniverse.ChEBITool[源代码]

基类:BaseTool

Tool for querying ChEBI (Chemical Entities of Biological Interest).

Provides compound lookup, text search, and ontology navigation for small molecules of biological relevance.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the ChEBI API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_get_compound(arguments)[源代码]

Get detailed compound information by ChEBI ID.

Search ChEBI by name, formula, or keyword using advanced search.

_ontology_children(arguments)[源代码]

Get ontology children of a ChEBI compound.

class tooluniverse.ChEMBLRESTTool[源代码]

基类:BaseTool

Generic ChEMBL REST API tool. Wrapper for ChEMBL API endpoints defined in chembl_tools.json. Supports all ChEMBL data resources: molecules, targets, assays, activities, drugs, etc.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments

_build_params(args)[源代码]

Build query parameters for ChEMBL API

_extract_parent_chembl_id(mol)[源代码]

Extract the parent ChEMBL ID from a molecule record.

_lookup_chembl_id_by_name(drug_name)[源代码]

Look up a ChEMBL molecule ID by preferred name (case-insensitive).

Feature-79B-001: Uses icontains first (most reliable), then iexact as fallback. The iexact and search endpoints frequently timeout for newer drugs. Returns the ChEMBL ID of the first matching molecule, or None.

run(arguments)[源代码]

Execute the ChEMBL API call

class tooluniverse.ChEMBLTool[源代码]

基类:BaseTool

使用ChEMBL Web Services API,根据给定的化合物名称或SMILES搜索相似分子的工具。

Note: This tool is designed for small molecule compounds only. Biologics (antibodies, proteins, oligonucleotides, etc.) do not have SMILES structures and cannot be used for structure-based similarity search. The tool will provide detailed error messages when biologics are queried, explaining the reason and suggesting alternative tools.

__init__(tool_config, base_url='https://www.ebi.ac.uk/chembl/api/data')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

get_chembl_id_by_name(compound_name)[源代码]

在 ChEMBL 中通过名称搜索化合物,并返回第一个匹配项的 ChEMBL ID。

get_smiles_pref_name_by_chembl_id(query)[源代码]

根据提供的ChEMBL ID,返回一个包含规范化SMILES和首选名称的字典。

get_chembl_smiles_pref_name_id_by_name(compound_name)[源代码]

在ChEMBL中按名称搜索化合物,并返回一个包含前5个匹配项的列表,每个列表项为一个字典,包含ChEMBL ID、规范化SMILES和首选名称。

_search_similar_molecules(query, similarity_threshold, max_results)[源代码]
class tooluniverse.ChIPAtlasTool[源代码]

基类:BaseTool

ChIP-Atlas API tool for accessing chromatin data. Provides enrichment analysis, peak browsing, and dataset search.

run(arguments)[源代码]

Execute the tool with given arguments.

_enrichment_analysis(arguments)[源代码]

Perform enrichment analysis on genomic regions, motifs, or gene lists. Identifies proteins bound to input regions more often than expected.

_get_experiment_list(arguments)[源代码]

Get metadata for all ChIP-Atlas experiments.

Note: The experimentList.tab file is 344MB+ (433k+ experiments). This method provides guidance on accessing the data rather than downloading.

_get_peak_data(arguments)[源代码]

Get URL for peak-call data (BigWig or BED format).

_search_datasets(arguments)[源代码]

Search for datasets by antigen or cell type.

class tooluniverse.ChemComputeTool[源代码]

基类:BaseTool

Local computational chemistry tools using RDKit.

No external API calls. Provides: - Synthetic Accessibility (SA) Score computation

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute chem compute tool with given arguments.

_sa_score(arguments)[源代码]

Calculate the Synthetic Accessibility (SA) score for a SMILES string.

class tooluniverse.ClinGenARTool[源代码]

基类:BaseTool

Tool for querying the ClinGen Allele Registry.

The Allele Registry normalizes variant nomenclature and provides canonical allele identifiers (CA IDs) that link to ClinVar, dbSNP, COSMIC, gnomAD, and other variant databases. Supports HGVS notation lookup and external record retrieval.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the ClinGen Allele Registry API call.

_query(arguments)[源代码]

Route to appropriate ClinGen AR endpoint.

_lookup_allele(arguments)[源代码]

Look up a variant by HGVS notation.

_get_external_records(arguments)[源代码]

Get external database records for a canonical allele ID.

class tooluniverse.ClinGenAlleleTool[源代码]

基类:BaseTool

Look up canonical allele identifiers and cross-database links.

__init__(tool_config)[源代码]
_lookup_hgvs(params)[源代码]

Look up a variant by HGVS expression to get canonical allele ID.

_get_allele(params)[源代码]

Get detailed information for a canonical allele by CA ID.

_format_allele(data)[源代码]

Format allele response into structured result.

run(params)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.ClinGenDosageTool[源代码]

基类:BaseTool

ClinGen Dosage Sensitivity JSON API tool.

Uses the search.clinicalgenome.org/api/dosage endpoint which returns structured JSON with detailed dosage sensitivity curations.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Route to operation handler based on config.

_dosage_by_gene(arguments)[源代码]

Search ClinGen dosage sensitivity curations by gene symbol.

Search dosage curations by genomic region.

class tooluniverse.ClinGenTool[源代码]

基类:BaseTool

ClinGen Database REST API tool.

Provides access to ClinGen curated data including gene-disease validity, dosage sensitivity, and clinical actionability.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Route to operation handler based on config.

_get_gene_validity(arguments)[源代码]

Get all gene-disease validity curations from ClinGen.

_search_gene_validity(arguments)[源代码]

Search gene-disease validity curations by gene symbol.

_get_dosage_sensitivity(arguments)[源代码]

Get all dosage sensitivity curations from ClinGen.

_search_dosage_sensitivity(arguments)[源代码]

Search dosage sensitivity curations by gene symbol.

_get_actionability_adult(arguments)[源代码]

Get clinical actionability curations for adult context.

_get_actionability_pediatric(arguments)[源代码]

Get clinical actionability curations for pediatric context.

_get_actionability(arguments, context)[源代码]

Get clinical actionability curations for a specific context.

_search_actionability(arguments)[源代码]

Search clinical actionability across both adult and pediatric contexts.

_get_variant_classifications(arguments)[源代码]

Get variant pathogenicity classifications from ClinGen Evidence Repository.

_parse_csv(csv_text)[源代码]

Parse CSV text into list of dictionaries.

Handles ClinGen’s special CSV format which has metadata headers before the actual data rows.

class tooluniverse.ClinVarGetClinicalSignificance[源代码]

基类:ClinVarRESTTool

Get clinical significance information for variants.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Get clinical significance by variant ID.

class tooluniverse.ClinVarGetVariantDetails[源代码]

基类:ClinVarRESTTool

Get detailed variant information by ClinVar ID.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Get variant details by ClinVar ID.

class tooluniverse.ClinVarRESTTool[源代码]

基类:BaseTool

Base class for ClinVar REST API tools.

__init__(tool_config)[源代码]
_make_request(endpoint, params=None, max_retries=3)[源代码]

Make a request to the ClinVar API with automatic retry for rate limiting.

_parse_variant_summary(vdata)[源代码]

Extract common fields from a single esummary variant record.

_fetch_variant(variant_id)[源代码]

Fetch a single variant by ID via esummary. Returns (variant_data, error_result) tuple-style dict.

On success: {“variant_data”: {…}, “result”: {…}} On error: {“error_result”: {…}}

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.ClinVarSearchVariants[源代码]

基类:ClinVarRESTTool

Search for variants in ClinVar by gene or condition.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Search variants by gene or condition.

class tooluniverse.ClinicalTrialsDetailsTool[源代码]

基类:ClinicalTrialsTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_simplify_output(study, query_type)[源代码]

手动提取通常最有用的信息

_extract_outcomes_from_output(study, outcome_measure)[源代码]
_extract_safety_from_output(study, organs, adverse_event_type)[源代码]
_remove_empty_values(obj)[源代码]
class tooluniverse.ClinicalTrialsGovTool[源代码]

基类:BaseTool

Tool for searching clinical trials using ClinicalTrials.gov API v2.

BASE_URL = 'https://clinicaltrials.gov/api/v2/studies'
run(arguments)[源代码]

Executes the ClinicalTrials tool action.

参数:

arguments (Dict[str, Any]) – Dictionary containing the action and its parameters. Expected keys: - action (str): “search_studies” or “get_study_details” - condition (str, optional): Condition to search for. - intervention (str, optional): Intervention/Drug to search for. - nct_id (str, optional): NCT ID for details. - limit (int, optional): Max results (default 10).

返回:

The results.

返回类型:

Dict[str, Any]

search_studies(condition=None, intervention=None, limit=10)[源代码]

Search for clinical trials.

get_study_details(nct_id)[源代码]

Get full details for a study.

class tooluniverse.ClinicalTrialsSearchTool[源代码]

基类:ClinicalTrialsTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行临床试验的搜索查询。

参数:

arguments (dict) – 由用户/LLM 提供的参数字典

退货
dict or str: The JSON response from the API as a dictionary,

对于非 JSON 响应的原始文本,或错误字典。

_simplify_output(response)[源代码]
class tooluniverse.ClinicalTrialsTool[源代码]

基类:RESTfulTool

_BASE_URL = 'https://clinicaltrials.gov/api/v2'
_OPERATION_URLS = {'field_values': '/stats/field-values', 'get_study': '/studies', 'search': '/studies', 'stats_size': '/stats/size'}
__init__(tool_config)[源代码]
_map_param_names(arguments)[源代码]

Maps the parameter names in the arguments dictionary to the expected parameter names defined in the tool’s JSON configuration.

参数:

arguments (dict) – Runtime arguments provided to the tool’s run method.

退货

dict: A new dictionary with mapped parameter names.

_prepare_api_params(arguments)[源代码]

Prepares the dictionary of parameters for the API query string based on tool config and runtime arguments.

参数:

arguments (dict) – Runtime arguments provided to the tool’s run method.

退货

dict: A dictionary of parameters ready for the API requests.

_format_endpoint_url(arguments)[源代码]

Formats the endpoint URL by substituting path parameters (like {nctId}) with values from the arguments dictionary.

参数:

arguments (dict) – Runtime arguments provided to the tool’s run method.

退货

str: The formatted endpoint URL.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

Handle search operations (search_studies, search_by_intervention, search_by_sponsor).

_run_get_study(arguments)[源代码]

Get full details for a single study by NCT ID.

_run_stats_size(arguments)[源代码]

Get aggregate ClinicalTrials.gov database statistics.

_run_field_values(arguments)[源代码]

Get value distribution for a specific field.

class tooluniverse.ClueTool[源代码]

基类:BaseTool

Tool for querying the CLUE.io L1000 Connectivity Map API.

Provides access to: - Perturbation signatures (genetic and chemical) - Gene expression profiles - Cell line information - Compound/drug information

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the CLUE.io API tool with given arguments.

_get_headers()[源代码]
_make_request(endpoint, params=None)[源代码]

Make GET request to CLUE.io API.

_unwrap_list(data)[源代码]

Extract the list payload from an API response that may be a list or a dict with a ‘data’ key.

_list_response(result)[源代码]

Build a standard success response with unwrapped list data, or an error response.

_search_signatures(arguments)[源代码]

Search L1000 perturbation signatures.

_get_perturbation(arguments)[源代码]

Get perturbation details by ID or name.

_get_gene_expression(arguments)[源代码]

Get gene information from L1000.

_get_cell_lines(arguments)[源代码]

Get cell line information from L1000.

_search_compounds(arguments)[源代码]

Search chemical compounds in L1000.

class tooluniverse.ComplexPortalTool[源代码]

基类:BaseTool

Tool for querying the EBI Complex Portal for curated protein complexes.

Provides access to: - Protein complex search by gene/protein name - Detailed complex compositions and stoichiometry - Complex function, disease associations, and cross-references - Data from CORUM and other curated complex databases

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Complex Portal API call.

_search_complexes(arguments)[源代码]

Search for protein complexes containing a given gene/protein.

Queries the Complex Portal search endpoint.

_get_complex(arguments)[源代码]

Get detailed information for a specific protein complex by its Complex Portal ID.

Returns full complex data including subunit composition, function, and cross-references.

class tooluniverse.ComposeTool[源代码]

基类:BaseTool

一个灵活的工具,可通过自定义代码逻辑组合其他工具。支持内联的composition_code和外部Python文件。具有智能依赖管理功能,可自动加载工具。

__init__(tool_config, tooluniverse=None)[源代码]

Initialize the ComposeTool.

参数:
  • tool_config (dict) – Tool configuration containing composition code or file reference

  • tooluniverse (ToolUniverse) – Reference to the ToolUniverse instance

_discover_tool_dependencies()[源代码]

从组合代码中自动发现工具依赖关系。

退货

set: Set of tool names that this composition calls

_get_tool_category_mapping()[源代码]

Create a mapping from tool names to their categories.

退货

dict: Mapping of tool names to category names

_load_missing_dependencies(missing_tools)[源代码]

自动加载缺失的工具依赖项。

参数:

missing_tools (set) – Set of missing tool names

退货

元组: (successfully_loaded, failed_to_load)

_load_code_from_file()[源代码]

从外部 Python 文件加载组合代码。

退货

str:作为字符串的组成代码

run(arguments, stream_callback=None)[源代码]

执行带有自定义代码逻辑的组合工具。

参数:
  • arguments (dict) – 组成的输入参数

  • stream_callback (callable, optional) – 用于流式输出的回调函数

退货

Any: Result from the composition execution

_emit_stream_chunk(chunk, stream_callback)[源代码]

如果提供了回调函数,则发出一个数据块流。

参数:
  • chunk (str) – 要发出的区块

  • stream_callback (callable, optional) – 用于流式输出的回调函数

_create_event_emitter(stream_callback)[源代码]

为 compose 脚本创建一个事件触发器函数。

参数:

stream_callback (callable, optional) – 用于流式输出的回调函数

退货

callable:事件触发器函数

_execute_from_file(arguments, stream_callback=None)[源代码]

从外部文件执行组合代码。

参数:
  • arguments (dict) – Input arguments

  • stream_callback (callable, optional) – 用于流式输出的回调函数

退货

Any: Result from the composition execution

_execute_inline_code(arguments, stream_callback=None)[源代码]

执行内联组合代码(现有行为)。

参数:
  • arguments (dict) – Input arguments

  • stream_callback (callable, optional) – 用于流式输出的回调函数

退货

Any: Result from the composition execution

_call_tool(tool_name, arguments)[源代码]

辅助函数,用于在组合代码中调用其他工具。

参数:
  • tool_name (str) – Name of the tool to call

  • arguments (dict) – Arguments to pass to the tool

退货

Any: Result from the tool execution

class tooluniverse.CorePDFSnippetsTool[源代码]

基类:BaseTool

Fetch an open-access PDF (commonly returned by CORE) and return bounded text snippets around user-provided terms.

Extraction backends (fastest first when extractor=”auto”): - PyMuPDF (fitz) - pypdf - markitdown

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.CoreTool[源代码]

基类:BaseTool

用于搜索CORE开放获取学术论文的工具。

__init__(tool_config=None)[源代码]

Search for papers using CORE API.

参数:
  • query (str) – Search query

  • limit (int) – Maximum number of results

  • year_from (int | None) – Start year filter

  • year_to (int | None) – End year filter

  • language (str | None) – Language filter (e.g., ‘en’, ‘es’, ‘fr’)

退货

纸质词典列表

_extract_authors(authors)[源代码]

Extract author names from CORE API response.

_extract_year(published_date)[源代码]

Extract year from published date.

run(tool_arguments)[源代码]

执行 CORE 搜索。

参数:

tool_arguments – 包含搜索参数的字典

退货

纸质词典列表

class tooluniverse.CrossrefRESTTool[源代码]

基类:BaseRESTTool

Generic REST tool for Crossref API endpoints.

_get_param_mapping()[源代码]

Map Crossref-specific parameter names.

_process_response(response, url)[源代码]

Process Crossref API response, extracting message wrapper.

class tooluniverse.CryoETTool[源代码]

基类:BaseTool

CryoET Data Portal tool for browsing cryo-electron tomography datasets, runs, tomograms, and annotations from the CZ BioHub portal.

run(arguments)[源代码]

Execute the tool with given arguments.

_list_datasets(arguments)[源代码]

List/search CryoET datasets with optional filters.

_get_dataset(arguments)[源代码]

Get full details for a specific dataset by numeric ID.

_list_runs(arguments)[源代码]

List experimental runs in a dataset.

_list_tomograms(arguments)[源代码]

List tomograms with voxel spacing and reconstruction info.

_list_annotations(arguments)[源代码]

List annotations (segmentations) for a run.

class tooluniverse.CrystalStructureTool[源代码]

基类:BaseTool

Validate crystal structure by computing density from unit cell parameters.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_validate(arguments)[源代码]
class tooluniverse.CustomTool[源代码]

基类:BaseTool

CustomTool class for executing dynamically generated tools

__init__(tool_config)[源代码]
_load_external_code()[源代码]

Load the execute_tool function from external Python file

_load_embedded_code(implementation)[源代码]

Load the execute_tool function from embedded source code

run(arguments=None)[源代码]

Execute the custom tool

参数:

arguments (Any) – Input arguments for the tool

退货

Dict containing the result of tool execution

class tooluniverse.DBLPTool[源代码]

基类:BaseTool

在 DBLP 计算机科学文献库中搜索出版物。

__init__(tool_config, base_url='https://dblp.org/search/publ/api')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.DBpediaSPARQLTool[源代码]

基类:BaseTool

Run SPARQL queries against DBpedia to retrieve structured knowledge.

DBpedia is a project that extracts structured information from Wikipedia and makes it available as linked data. This tool is particularly useful for querying information about people, places, organizations, works, and other entities, especially in humanities and social sciences domains.

参数(参数):

sparql (str): SPARQL query string max_results (int): Optional result limit override

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.DataQualityTool[源代码]

基类:BaseTool

Assess tabular data quality: missing values, outliers, correlations.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_assess(arguments)[源代码]
class tooluniverse.DGIdbTool[源代码]

基类:BaseTool

Tool for querying DGIdb REST API.

DGIdb provides drug-gene interaction data including: - Drug-gene interactions from 30+ sources - Druggability annotations - Gene categories (kinase, ion channel, etc.)

No authentication required. Free for academic/research use.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the DGIdb API call.

_get_interactions(arguments)[源代码]

Get drug-gene interactions for genes using GraphQL.

_get_genes(arguments)[源代码]

Get gene information including druggability using GraphQL.

_get_drugs(arguments)[源代码]

Get drug information using GraphQL.

_get_gene_categories(arguments)[源代码]

Get gene categories (druggability annotations) using GraphQL.

class tooluniverse.DNATool[源代码]

基类:BaseTool

Local DNA sequence analysis and design tools.

No external API calls. Provides: - Restriction site detection (NEB enzyme library) - Open reading frame (ORF) finding - GC content calculation - Reverse complement generation - DNA to protein translation

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute DNA analysis tool with given arguments.

_validate_dna_sequence(seq)[源代码]

Validate DNA sequence, returns error message or None if valid.

_find_restriction_sites(arguments)[源代码]

Find restriction enzyme recognition sites in a DNA sequence.

_find_orfs(arguments)[源代码]

Find open reading frames (ORFs) in a DNA sequence.

_calculate_gc_content(arguments)[源代码]

Calculate GC content and nucleotide composition of a DNA sequence.

_reverse_complement(arguments)[源代码]

Generate the reverse complement of a DNA sequence.

_translate_sequence(arguments)[源代码]

Translate a DNA sequence to protein using the standard codon table.

_codon_optimize(arguments)[源代码]

Codon-optimize an amino acid sequence for expression in a target species.

_virtual_digest(arguments)[源代码]

Perform a virtual restriction digest of a DNA sequence.

_calc_tm_nn(primer)[源代码]

Calculate melting temperature using SantaLucia 1998 nearest-neighbor model.

Uses terminal-specific initiation parameters (SantaLucia 1998, Table 2):

GC terminal: dH = +0.1 kcal/mol, dS = -2.8 cal/mol/K (per end) AT terminal: dH = +2.3 kcal/mol, dS = +4.1 cal/mol/K (per end)

Applied to both the 5’ and 3’ terminal base pairs.

Requires a fully-resolved sequence (no ambiguous bases). N-containing dinucleotides are absent from NN_PARAMS; silently skipping them underestimates dH/dS and produces an erroneously low Tm. Returns 0.0 for sequences containing N (same sentinel as length < 2).

_primer_design(arguments)[源代码]

Design PCR primers for a target region using nearest-neighbor Tm calculation.

_gibson_design(arguments)[源代码]

Design Gibson Assembly overlaps for a set of DNA fragments.

_golden_gate_design(arguments)[源代码]

Design Golden Gate Assembly parts with BsaI or BbsI overhangs.

class tooluniverse.DOAJTool[源代码]

基类:BaseTool

搜索 DOAJ(开放获取期刊目录)中的文章和期刊。

参数(参数):

query (str): 查询字符串(支持 DOAJ 的 Lucene 语法) max_results (int): 最大结果数(默认值为 10,最大值为 100) type (str): “articles” 或 “journals”(默认值:”articles”)

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.DailyMedSPLParserTool[源代码]

基类:BaseTool

Parse DailyMed SPL XML into structured data (adverse reactions, dosing, contraindications, interactions, PK).

__init__(tool_config)[源代码]
run(arguments)[源代码]

Route to parser based on operation.

_with_data_payload(result)[源代码]

Ensure successful operation responses include a standardized data wrapper.

_fetch_spl_xml(setid)[源代码]

Fetch SPL XML from DailyMed API.

_parse_adverse_reactions(root)[源代码]

Parse adverse reactions section into structured table.

_parse_dosing(root)[源代码]

Parse dosage and administration section.

_parse_contraindications(root)[源代码]

Parse contraindications section.

_parse_drug_interactions(root)[源代码]

Parse drug interactions section.

_parse_clinical_pharmacology(root)[源代码]

Parse clinical pharmacology section.

_extract_table_data(table_element)[源代码]

Extract structured data from table element.

class tooluniverse.DataCiteRESTTool[源代码]

基类:BaseRESTTool

REST tool for DataCite API endpoints with custom parameter mapping.

_get_param_mapping()[源代码]

Map tool parameter names to DataCite API query parameter names.

_process_response(response, url)[源代码]

Process DataCite API response.

For search endpoints: data is the list of items, meta has total. For single-item endpoints: data is the single record object.

class tooluniverse.DataGovTool[源代码]

基类:BaseTool

Search US federal open data catalog (Data.gov) for datasets.

run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.DatasetTool[源代码]

基类:BaseTool

用于搜索和筛选DrugBank词汇数据集的工具。提供按名称、ID、同义词搜索药物的功能,并可根据各种条件进行筛选。

__init__(tool_config)[源代码]
_load_dataset()[源代码]

加载 drugbank 词汇表 CSV 数据集。

run(arguments)[源代码]

工具的主要入口点。

通过名称、编号、同义词或其他字段使用文本查询搜索药物。

该功能专用于在指定字段中进行基于文本的搜索。它根据用户偏好执行子字符串匹配或精确匹配。

参数:

arguments (dict) – 搜索参数包括: - query(字符串):搜索文本 - search_fields(列表):搜索的字段 - case_sensitive(布尔值):是否区分大小写 - exact_match(布尔值):是否进行精确匹配 - limit(整数):最大结果数量

退货

dict:包含匹配记录及元数据的搜索结果

_drugbank_filter(arguments)[源代码]

根据特定标准和字段条件筛选药物。

此功能专用于基于条件的过滤,采用简单的字段-条件-数值参数。支持的过滤类型包括 contains、starts_with、ends_with、exact、not_empty。

参数:

arguments (dict) – 过滤参数包括: - field(字符串):用于过滤的字段名称 - condition(字符串):条件类型(包含、以…开头、以…结尾、完全匹配、非空) - value(字符串):用于过滤的值(对于非空条件可选) - limit(整数):结果的最大数量

退货

dict: 过滤后的结果,包含匹配的记录和已应用的筛选条件

get_dataset_info()[源代码]

获取有关已加载数据集的信息。

class tooluniverse.DbfetchRESTTool[源代码]

基类:BaseTool

Dbfetch REST API tool. Generic wrapper for Dbfetch API endpoints defined in dbfetch_tools.json.

__init__(tool_config)[源代码]
_build_params(args)[源代码]

Build query parameters for Dbfetch API

run(arguments)[源代码]

Execute the Dbfetch API call

class tooluniverse.DeepGOTool[源代码]

基类:BaseTool

Tool for predicting protein function using DeepGO.

BASE_URL = 'https://deepgo.cbrc.kaust.edu.sa/deepgo'
API_VERSION = '1.0.26'
__init__(tool_config)[源代码]
run(arguments)[源代码]

Route to appropriate operation handler.

_predict_function(arguments)[源代码]

Predict protein function from sequence.

class tooluniverse.DegreesOfUnsaturationTool[源代码]

基类:BaseTool

Calculate degrees of unsaturation from a molecular formula.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_calculate(arguments)[源代码]
class tooluniverse.DepMapTool[源代码]

基类:BaseTool

Tool for querying DepMap/Sanger Cell Model Passports API.

Provides access to: - Cancer cell line dependency data (CRISPR screens) - Drug sensitivity profiles - Cell line metadata and annotations - Gene effect scores for target validation

No authentication required for non-commercial use.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the DepMap API call.

_get_cell_lines(arguments)[源代码]

Get list of cancer cell lines with metadata.

Filter by tissue type or cancer type.

_get_cell_line(arguments)[源代码]

Get detailed information for a specific cell line.

Returns metadata, mutations, and available data types.

_search_cell_lines(arguments)[源代码]

Search cell lines by name or identifier.

_get_gene_dependencies(arguments)[源代码]

Get CRISPR gene dependency data.

Returns gene effect scores indicating essentiality in cancer cell lines. Negative scores indicate the gene is essential (cell death upon knockout).

_search_genes(arguments)[源代码]

Search for genes in DepMap by symbol.

The Sanger Cell Model Passports API gene filter is limited, so this method fetches sorted gene batches and filters client-side.

_get_drug_response(arguments)[源代码]

Get drug sensitivity data for cell lines.

Returns IC50/AUC values for drug-cell line combinations.

class tooluniverse.DetailedTermInfo[源代码]

基类:TermInfo

Extended term details in OLS.

description: List[str] | None
synonyms: List[str] | None
_abc_impl = <_abc._abc_data object>
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class tooluniverse.DfamTool[源代码]

基类:BaseTool

Tool for querying Dfam transposable element / repeat element database.

Supports: - Search TE families by name prefix, clade (taxon ID), and repeat type - Get detailed family info including consensus sequence and classification - Get TE annotation hits for genomic regions

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Dfam API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_search_families(arguments)[源代码]

Search Dfam TE families by name prefix, clade, or repeat type.

_get_family(arguments)[源代码]

Get detailed info for a specific Dfam TE family.

_get_annotations(arguments)[源代码]

Get TE annotation hits for a genomic region.

class tooluniverse.DisGeNETTool[源代码]

基类:BaseTool

Tool for querying DisGeNET gene-disease association database.

DisGeNET provides: - Gene-disease associations (GDAs) - Variant-disease associations (VDAs) - Disease-disease associations - Aggregated evidence scores

Requires API key via DISGENET_API_KEY environment variable. Register for free at https://www.disgenet.org/

__init__(tool_config)[源代码]
_get_headers()[源代码]

Get request headers with authentication.

run(arguments)[源代码]

Execute DisGeNET API call based on operation type.

_search_gene(arguments)[源代码]

Search for gene-disease associations by gene symbol.

参数:

arguments (Dict[str, Any]) – Dict containing: - gene: Gene symbol (e.g., BRCA1, TP53) - limit: Maximum results (default 10)

_search_disease(arguments)[源代码]

Search for disease information and associated genes.

参数:

arguments (Dict[str, Any]) – Dict containing: - disease: Disease name or ID (UMLS CUI, e.g., C0006142 for breast cancer) - limit: Maximum results (default 10)

_get_gene_disease_associations(arguments)[源代码]

Get gene-disease associations with filtering options.

参数:

arguments (Dict[str, Any]) – Dict containing: - gene: Gene symbol (optional if disease provided) - disease: Disease ID (optional if gene provided) - source: Data source filter (CURATED, ANIMAL_MODELS, LITERATURE, etc.) - min_score: Minimum GDA score (0-1) - limit: Maximum results

_get_variant_disease_associations(arguments)[源代码]

Get variant-disease associations.

参数:

arguments (Dict[str, Any]) – Dict containing: - variant: Variant ID (rsID, e.g., rs1234) - gene: Gene symbol to get all variants - limit: Maximum results

_get_disease_genes(arguments)[源代码]

Get all genes associated with a disease.

参数:

arguments (Dict[str, Any]) – Dict containing: - disease: Disease ID (UMLS CUI) or disease name - min_score: Minimum association score (0-1) - limit: Maximum results

class tooluniverse.DisProtTool[源代码]

基类:BaseTool

Tool for querying DisProt intrinsically disordered protein database.

Supports: - Search disordered proteins by text query - Get detailed disorder region annotations for a specific protein

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the DisProt API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

Search DisProt for disordered proteins.

_get_entry(arguments)[源代码]

Get detailed disorder regions for a DisProt entry.

class tooluniverse.DiseaseOntologyTool[源代码]

基类:BaseTool

Tool for querying the Disease Ontology (DO) REST API.

The Disease Ontology semantically integrates disease and medical vocabularies through cross-mapping of DO terms to MeSH, ICD, NCI Thesaurus, SNOMED CT, and OMIM.

Supports: term lookup, parent hierarchy navigation.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Disease Ontology API call.

_query(arguments)[源代码]

Route to appropriate Disease Ontology endpoint.

_fetch_term(doid)[源代码]

Fetch a single DO term by DOID.

_get_term(arguments)[源代码]

Get detailed information about a Disease Ontology term.

_get_parents(arguments)[源代码]

Get parent terms for a Disease Ontology term with hierarchy navigation.

class tooluniverse.DiseaseTargetScoreTool[源代码]

基类:GraphQLTool

从特定数据源中提取疾病-靶点关联评分的工具

__init__(tool_config, datasource_id=None)[源代码]
run(arguments)[源代码]

提取特定数据源的疾病-靶点评分 参数应包含:efoId,datasourceId(可选),pageSize(可选)

class tooluniverse.DoseResponseTool[源代码]

基类:BaseTool

Local dose-response curve fitting and IC50 calculation tools.

Implements the 4-Parameter Logistic (4PL) model: f(x) = Bottom + (Top - Bottom) / (1 + (IC50/x)^Hill)

No external API required. Uses scipy.optimize for curve fitting.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute dose-response analysis.

_fit_4pl(concentrations, responses)[源代码]

Fit Hill / 4PL sigmoidal model to dose-response data.

_fit_curve(arguments)[源代码]

Fit 4PL dose-response curve and return all parameters.

_calculate_ic50(arguments)[源代码]

Extract IC50 from dose-response data via 4PL fitting.

static _interpret_potency(fold_shift)[源代码]

Return a human-readable potency comparison string.

_compare_potency(arguments)[源代码]

Compare IC50 fold-shift between two compounds.

class tooluniverse.DrugCentralTool[源代码]

基类:BaseTool

Tool for accessing DrugCentral data via MyChem.info.

Provides drug target information, indications, contraindications, off-label uses, regulatory approvals, and cross-references from DrugCentral’s curated database.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the DrugCentral data query.

_search_drugs(arguments)[源代码]

Search for drugs with DrugCentral data via MyChem.info.

_resolve_name_to_id(name)[源代码]

Resolve drug name to MyChem.info ID via search.

_get_drug(arguments)[源代码]

Get detailed DrugCentral data for a drug by InChIKey, ChEMBL ID, or drug name.

_get_targets(arguments)[源代码]

Get drug targets from DrugCentral bioactivity data.

class tooluniverse.DrugPropertiesTool[源代码]

基类:BaseTool

Drug-likeness property filters and assessments using RDKit.

Endpoints: - lipinski_filter: Lipinski Ro5 + Veber + Pfizer 3/75 + Egan + Ghose - calculate_qed: QED score + full descriptor profile - pains_filter: PAINS + Brenk + NIH substructure filters

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_parse_smiles(arguments)[源代码]
_lipinski_filter(arguments)[源代码]

Check Lipinski Ro5, Veber, Pfizer 3/75, Egan, and Ghose filters.

_calculate_qed(arguments)[源代码]

Calculate QED (Quantitative Estimate of Drug-likeness) score.

_pains_filter(arguments)[源代码]

Check for PAINS, Brenk, and NIH undesirable substructures.

class tooluniverse.DrugSynergyTool[源代码]

基类:BaseTool

Local drug combination synergy analysis tools.

Implements standard pharmacological synergy models: - Bliss Independence model - Highest Single Agent (HSA) model - ZIP (Zero Interaction Potency) model - Loewe Additivity model - Combination Index (Chou-Talalay) model

No external API required. Uses numpy/scipy for computation.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_interpret_synergy_score(score, model)[源代码]
_calculate_bliss(arguments)[源代码]

Calculate Bliss Independence synergy score.

Bliss model: E_expected = E_a + E_b - E_a * E_b Synergy score = E_combination - E_expected Positive score = synergy; Negative = antagonism.

Effects should be expressed as fractional inhibition (0-1).

_calculate_hsa(arguments)[源代码]

Calculate Highest Single Agent (HSA) synergy score.

HSA model: E_expected = max(E_a, E_b) at each dose point Synergy = E_combination - max single agent effect.

_calculate_zip(arguments)[源代码]

Calculate ZIP (Zero Interaction Potency) synergy score.

ZIP model uses dose-response curves to calculate delta scores. Input: doses_a, doses_b (1D arrays), viability_matrix (2D). Output: ZIP delta synergy score.

_fit_hill_for_loewe(doses, effects)[源代码]

Fit a Hill/sigmoid model: f(d) = Emax * d^m / (Dm^m + d^m) Returns (Dm, m, Emax) or None if fitting fails. Dm = dose producing half-maximal effect (IC50/EC50). m = Hill coefficient (slope). Emax = maximum effect.

_calculate_loewe(arguments)[源代码]

Calculate Loewe Additivity synergy score.

Loewe model: d_a/D_a(E) + d_b/D_b(E) = 1 for additive combinations. Where D_a(E) and D_b(E) are the doses of A and B alone that produce effect E. If the sum < 1, the combination is synergistic; > 1 antagonistic.

Requires dose-response data for each drug individually, plus combination doses and their observed effects.

_calculate_ci(arguments)[源代码]

Calculate Chou-Talalay Combination Index (CI).

Based on the Median Effect Equation: fa/fu = (D/Dm)^m where fa = fraction affected, fu = fraction unaffected, D = dose, Dm = median-effect dose (IC50), m = Hill coefficient.

CI < 1: synergy CI = 1: additive CI > 1: antagonism

Supports both mutually exclusive (MEE) and mutually non-exclusive (MNEE) assumptions.

class tooluniverse.DynaMut2Tool[源代码]

基类:BaseTool

Tool for predicting the effect of single-point mutations on protein stability and dynamics using the DynaMut2 web server.

Supports two operations: - predict_stability: Submit a stability prediction for a PDB structure

with a specified single-point mutation. Downloads the PDB file from RCSB, uploads to DynaMut2, and polls for results.

  • get_job: Retrieve results for a previously submitted DynaMut2 job by job ID.

The prediction returns ddG (change in Gibbs free energy, kcal/mol). Positive values indicate stabilizing mutations; negative values indicate destabilizing mutations.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the DynaMut2 tool with given arguments.

_predict_stability(arguments)[源代码]

Predict the stability effect of a single-point mutation on a protein.

Steps: 1. Download PDB file from RCSB 2. Upload to DynaMut2 with mutation and chain 3. Poll for results 4. Return structured prediction

_get_job(arguments)[源代码]

Retrieve results for a previously submitted DynaMut2 job.

_poll_job_status(endpoint, job_id, max_wait=300, interval=10)[源代码]

Poll DynaMut2 job status until completion or timeout.

参数:
  • endpoint – API endpoint (e.g., ‘prediction_single’)

  • job_id – Job ID string

  • max_wait – Maximum seconds to wait

  • interval – Seconds between poll attempts

返回:

dict with result data if complete, or None if timeout

class tooluniverse.DynamicPackageDiscovery[源代码]

基类:BaseTool

Searches PyPI and evaluates packages dynamically based on requirements

__init__(tool_config)[源代码]
_search_pypi_via_web(query)[源代码]

Search PyPI using web search tool

_evaluate_package(package_name)[源代码]

Evaluate a package’s suitability by fetching PyPI metadata

_rank_packages(packages, requirements, functionality)[源代码]

Rank packages by relevance and quality

run(arguments)[源代码]

Dynamically discover and evaluate packages

参数:
  • requirements – Description of what’s needed

  • functionality – Specific functionality required

  • constraints – Any constraints (Python version, license, etc.)

class tooluniverse.EBIProteinsCoordinatesTool[源代码]

基类:BaseTool

Tool for querying EBI Proteins API coordinate mappings.

Supports: - Map protein positions to genomic coordinates (exon-level) - Get protein-to-genome coordinate mappings for a UniProt accession

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EBI Proteins Coordinates API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_coordinates(arguments)[源代码]

Get protein-to-genomic coordinate mappings.

class tooluniverse.EBIProteinsEpitopeTool[源代码]

基类:BaseTool

Tool for querying protein epitope data from the EBI Proteins API.

Epitopes are regions of proteins recognized by the immune system (antibodies, T cells). This tool retrieves experimentally-determined epitope regions from the Immune Epitope Database (IEDB), including epitope sequences, positions, and supporting literature.

Useful for: vaccine design, therapeutic antibody development, immunogenicity assessment, B-cell/T-cell epitope mapping.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EBI Proteins epitope API call.

_get_epitopes(arguments)[源代码]

Get epitope features for a protein by UniProt accession.

class tooluniverse.EBIProteinsExtTool[源代码]

基类:BaseTool

Extended tool for EBI Proteins API covering mutagenesis and PTM data.

These endpoints provide detailed mutagenesis experiment results and mass spectrometry-based post-translational modification evidence mapped to UniProt protein sequences.

Supports: mutagenesis data, proteomics PTM evidence.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EBI Proteins API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_mutagenesis(arguments)[源代码]

Get mutagenesis experiment data for a protein.

_get_proteomics_ptm(arguments)[源代码]

Get post-translational modification evidence from mass spec proteomics.

_get_variation(arguments)[源代码]

Get protein sequence variants from multiple sources.

_get_features(arguments)[源代码]

Get protein features filtered by category.

_get_antigen(arguments)[源代码]

Get antigenic regions for a protein (useful for antibody design).

_get_coordinates(arguments)[源代码]

Get genomic coordinates for a protein.

_get_proteomics(arguments)[源代码]

Get proteomics peptide evidence for a protein.

class tooluniverse.EBIProteinsFeaturesTool[源代码]

基类:BaseTool

Tool for retrieving category-specific protein features from EBI Proteins API.

Different from EBIProteinsExtTool (mutagenesis, PTM) - this covers domain/site annotations, molecule processing info, and secondary structure.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EBI Proteins API features call.

_get_features(arguments)[源代码]

Get features for a specific category.

class tooluniverse.EBIProteinsInteractionsTool[源代码]

基类:BaseTool

Tool for querying EBI Proteins protein-protein interaction data.

Supports: - Get interaction partners for a protein (from IntAct) - Get detailed protein info with interactions, diseases, locations

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EBI Proteins Interactions API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_interactions(arguments)[源代码]

Get protein-protein interaction partners.

_get_interaction_details(arguments)[源代码]

Get protein info with interactions, diseases, and locations.

class tooluniverse.EBISearchRESTTool[源代码]

基类:BaseTool

EBI Search API tool. Generic wrapper for EBI Search API endpoints defined in ebi_search_tools.json.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments

_build_params(args)[源代码]

Build query parameters for EBI Search API

_find_entry_id_via_search(domain, query)[源代码]

Find entry ID via search and return entry data

_extract_data(data, extract_path=None)[源代码]

Extract specific data from API response

run(arguments)[源代码]

Execute the EBI Search API call

class tooluniverse.EBITaxonomyTool[源代码]

基类:BaseTool

Tool for querying the EBI Taxonomy REST API.

Provides taxonomy lookup by ID, scientific name, common/any name, and name suggestion for search or submission. Returns taxonomic classification including lineage, rank, division, and genetic codes.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EBI Taxonomy API call.

_query(arguments)[源代码]

Route to the appropriate EBI Taxonomy endpoint.

_get_by_tax_id(arguments)[源代码]

Get taxonomy information by NCBI Taxonomy ID.

_get_by_scientific_name(arguments)[源代码]

Get taxonomy information by scientific name.

_get_by_any_name(arguments)[源代码]

Get taxonomy by any name (scientific, common, synonym).

_get_suggestions(arguments)[源代码]

Get taxonomy name suggestions for search.

class tooluniverse.EFOTool[源代码]

基类:BaseTool

通过EMBL-EBI OLS API查找疾病的实验因子本体(EFO)ID的工具。

__init__(tool_config, base_url='https://www.ebi.ac.uk/ols4/api/search')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.ELMTool[源代码]

基类:BaseTool

Tool for querying the ELM (Eukaryotic Linear Motif) database.

Supported operations: - get_instances: Get experimentally validated motif instances for a protein - list_classes: List all ELM motif classes with regex patterns

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the ELM tool with given arguments.

_parse_tsv(text)[源代码]

Parse ELM TSV response, skipping comment lines.

_get_instances(arguments)[源代码]

Get experimentally validated motif instances for a protein.

_list_classes(arguments)[源代码]

List ELM motif classes with regex patterns and descriptions.

class tooluniverse.EMDBRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.EMPIARTool[源代码]

基类:BaseTool

Tool for accessing the EMPIAR database of raw electron microscopy images.

EMPIAR_API_BASE = 'https://www.ebi.ac.uk/empiar/api'
EBI_SEARCH_BASE = 'https://www.ebi.ac.uk/ebisearch/ws/rest/empiar'
__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_entries(args)[源代码]

Search EMPIAR entries via EBI Search API.

_get_entry(args)[源代码]

Get detailed EMPIAR entry by ID.

class tooluniverse.EMoleculesTool[源代码]

基类:BaseTool

Tool for searching eMolecules vendor aggregator.

eMolecules provides: - Multi-vendor compound search - Pricing and availability - Structure search - Building block sourcing

Note: Full API access may require registration. Basic search functionality available without API key.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute eMolecules query based on operation type.

Search eMolecules by keyword or compound name.

Note: eMolecules does not provide a public API. This tool returns search URLs for the eMolecules web interface.

参数:

arguments (Dict[str, Any]) – Dict containing: - query: Search query - max_results: Maximum results (default 20)

_search_smiles(arguments)[源代码]

Search eMolecules by SMILES structure.

Note: eMolecules does not provide a public API. This tool returns search URLs for the eMolecules web interface.

参数:

arguments (Dict[str, Any]) – Dict containing: - smiles: SMILES string - search_type: exact, substructure, similarity (default: similarity)

_get_vendors(arguments)[源代码]

Get list of vendors for a compound.

Note: eMolecules does not provide a public API. This tool returns search URLs for vendor lookup on the eMolecules web interface.

参数:

arguments (Dict[str, Any]) – Dict containing: - smiles: SMILES string

_get_compound(arguments)[源代码]

Get compound details by eMolecules ID.

Note: eMolecules does not provide a public API. This tool returns URLs for viewing compound details on the eMolecules web interface.

参数:

arguments (Dict[str, Any]) – Dict containing: - emol_id: eMolecules compound ID

class tooluniverse.ENABrowserRESTTool[源代码]

基类:BaseTool

ENA Browser API REST tool. Generic wrapper for ENA Browser API endpoints defined in ena_browser_tools.json.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments

_build_params(args)[源代码]

Build query parameters for ENA Browser API

run(arguments)[源代码]

Execute the ENA Browser API call

class tooluniverse.ENAPortalTool[源代码]

基类:BaseTool

Tool for querying the European Nucleotide Archive (ENA) Portal API.

Supports searching for studies, samples, and sequences with flexible filtering by taxonomy, text content, and custom field selection.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the ENA Portal API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_search_studies(arguments)[源代码]

Search ENA studies by text query or taxonomy.

_search_samples(arguments)[源代码]

Search ENA samples by text query or taxonomy.

_count(arguments)[源代码]

Count records matching a query in ENA.

tooluniverse.ENCODEFilesTool

ENCODESearchTool 的别名

class tooluniverse.ENCODERESTTool[源代码]

基类:BaseRESTTool

Generic REST tool for ENCODE detail endpoints.

run(arguments)[源代码]

ENCODE uses custom _http_get helper, so we override the full run method.

tooluniverse.ENCODESearchBiosamplesTool

ENCODESearchTool 的别名

class tooluniverse.ENCODESearchTool[源代码]

基类:object

Generic search tool for ENCODE database.

Searches experiments, files, or biosamples depending on search_type in config. Consolidates ENCODESearchTool, ENCODEFilesTool, and ENCODESearchBiosamplesTool.

__init__(tool_config=None)[源代码]
handle_error(exception)[源代码]

Classify exceptions into structured ToolError.

run(arguments)[源代码]
class tooluniverse.EOLTool[源代码]

基类:BaseTool

Tool for querying the Encyclopedia of Life (EOL).

EOL aggregates biodiversity data from hundreds of sources into a comprehensive knowledge base covering ~3.6 million species pages. Provides species search, detailed taxon pages with media (images, text descriptions), taxonomy hierarchies from multiple classification systems, and curated collections.

Supports: species search, taxon page details, taxonomy hierarchy, collections browse.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EOL API call.

_query(arguments)[源代码]

Route to appropriate EOL endpoint.

Search for species/taxa by name.

static _strip_html(text)[源代码]

Remove HTML tags from text.

_get_page(arguments)[源代码]

Get detailed species/taxon page by EOL page ID.

_get_hierarchy_entry(arguments)[源代码]

Get taxonomy hierarchy for a specific classification entry.

_get_collection(arguments)[源代码]

Get EOL curated collection details.

class tooluniverse.EPMCAnnotationsTool[源代码]

基类:BaseRESTTool

Tool for retrieving text-mined annotations from Europe PMC articles.

Provides: - Get genes/proteins mentioned in a paper - Get diseases mentioned in a paper - Get chemicals/drugs mentioned in a paper - Get organisms mentioned in a paper - Get GO terms mentioned in a paper

Uses PubMed IDs (PMID) or PMC IDs. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Annotations API call.

_query(arguments)[源代码]

Route to the appropriate operation.

_get_annotations(arguments)[源代码]

Get all text-mined annotations from an article.

_get_entity_type(arguments, entity_type)[源代码]

Get annotations of a specific type from an article.

class tooluniverse.ESMFoldTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.ESMTool[源代码]

基类:BaseTool

ESM3 / ESMC tool for protein sequence embeddings, generation, structure prediction, and sequence scoring via the EvolutionaryScale Forge API.

run(arguments)[源代码]

Execute the tool with given arguments.

_get_protein_embedding(arguments)[源代码]

Get ESMC per-residue and mean-pooled embeddings for a protein sequence.

_generate_protein_sequence(arguments)[源代码]

Generate or complete a protein sequence using ESM3.

_fold_protein(arguments)[源代码]

Predict protein structure with ESM3, returning pTM score and coordinates.

_score_sequence(arguments)[源代码]

Score a protein sequence using ESMC logits (per-residue log-probabilities).

class tooluniverse.EVETool[源代码]

基类:BaseTool

Tool for querying EVE variant effect predictions.

EVE provides: - Unsupervised pathogenicity predictions trained on evolutionary data - Scores from 0 (benign) to 1 (pathogenic) - Predictions for single amino acid variants

EVE scores complement supervised methods like ClinVar annotations. Uses Ensembl VEP API with EVE plugin for variant scoring.

PATHOGENIC_THRESHOLD = 0.5
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EVE API call.

_classify_score(score)[源代码]

Classify EVE score.

_get_variant_score(arguments)[源代码]

Get EVE score for a variant using Ensembl VEP.

Supports both genomic coordinates and HGVS notation.

_get_gene_info(arguments)[源代码]

Check if EVE scores are available for a gene.

EVE provides predictions for ~3,000 disease-related genes.

class tooluniverse.EmbeddingCollectionSearchTool[源代码]

基类:BaseTool

Generic search tool for any embedding datastore collection.

Runtime arguments

querystr (required)

Search query text.

methodstr = “hybrid”

One of: “keyword”, “embedding”, “hybrid”.

top_kint = 10

Number of results to return.

alphafloat = 0.5

Balance for hybrid search (0=keyword only, 1=embedding only).

returns:
  • doc_id

  • doc_key

  • text

  • metadata

  • score

  • snippet (first ~280 chars)

rtype:

List[dict] with keys

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.EmbeddingDatabase[源代码]

基类:BaseTool

Exposes actions:
  • create_from_docs

  • add_docs

  • search

Backed by SQLiteStore + VectorStore + Embedder.

__init__(tool_config)[源代码]
_paths(name)[源代码]
_stores(name)[源代码]
_embedder(provider, model)[源代码]
_get_collection_meta(store, name)[源代码]
_existing_vector_doc_ids(vs, collection, doc_ids)[源代码]
static _validate_doc_args(args)[源代码]

Validate and extract common arguments for document operations.

Returns (error_dict, name, docs, metas) where error_dict is None on success.

static _build_doc_rows(docs, metas)[源代码]

Build (doc_key, text, meta, text_hash) rows and the corresponding key list.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_create_from_documents(args)[源代码]
_add_documents(args)[源代码]
class tooluniverse.EmbeddingSync[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_upload(args)[源代码]
_download(args)[源代码]
class tooluniverse.EnamineTool[源代码]

基类:BaseTool

Tool for searching Enamine compound libraries.

Enamine provides: - Make-on-demand compounds (REAL database) - Building blocks - Screening libraries - Fragment libraries

Note: Full API access may require registration. Basic search functionality available without API key.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute Enamine query based on operation type.

_search_catalog(arguments)[源代码]

Search Enamine catalog by keyword or compound name.

参数:

arguments (Dict[str, Any]) – Dict containing: - query: Search query - catalog: Catalog type (REAL, BB, SCR) - default: all

_get_compound(arguments)[源代码]

Get compound by Enamine ID.

参数:

arguments (Dict[str, Any]) – Dict containing: - enamine_id: Enamine compound ID (e.g., Z1234567890)

_search_smiles(arguments)[源代码]

Search Enamine by SMILES structure.

参数:

arguments (Dict[str, Any]) – Dict containing: - smiles: SMILES string - search_type: exact, substructure, similarity (default: similarity)

_get_libraries(arguments)[源代码]

Get available Enamine compound libraries.

Returns information about Enamine’s screening libraries.

class tooluniverse.EnrichrExtTool[源代码]

基类:BaseTool

Extended Enrichr tools for gene set enrichment analysis.

Operations: - list_libraries: List all available gene set libraries with statistics - enrich: Submit a gene list and get enrichment results for a library - get_top_enriched: Submit genes and return top enriched terms across libraries

__init__(tool_config)[源代码]
run(params)[源代码]

Route to the appropriate operation.

_list_libraries(params)[源代码]

List all available Enrichr gene set libraries with statistics.

_submit_genes(gene_list)[源代码]

Submit a gene list to Enrichr and return the user list ID.

_enrich(params)[源代码]

Submit gene list and get enrichment results for a specific library.

_get_top_enriched(params)[源代码]

Get top enriched terms across multiple libraries.

class tooluniverse.EnrichrTool[源代码]

基类:BaseTool

Tool to perform gene enrichment analysis using Enrichr.

__init__(tool_config)[源代码]
run(arguments)[源代码]

工具的主要入口点。

get_official_gene_name(gene_name)[源代码]

Retrieve the official gene symbol for a given gene name or synonym using the MyGene.info API.

参数

gene_name (str): The gene name or synonym to query.

退货

str: The official gene symbol if found; otherwise, raises an Exception.

submit_gene_list(gene_list)[源代码]

Submit the gene list to Enrichr and return the user list ID.

参数

gene_list (str): Newline-separated string of gene names.

退货

str: The user list ID from Enrichr.

get_enrichment_results(user_list_id, library)[源代码]

Fetch enrichment results for a specific library.

参数

user_list_id (str): The user list ID from Enrichr. library (str): The name of the enrichment library.

退货

dict: The enrichment results.

build_graph(genes, enrichment_results)[源代码]

Initialize and build the graph with gene nodes and enriched terms.

参数

genes (list): List of gene names. enrichment_results (dict): Dictionary of enrichment results by library.

退货

networkx.Graph: The constructed graph.

rank_paths_by_weight(G, source, target)[源代码]

Find and rank paths between source and target based on total edge weight.

参数

G (networkx.Graph): The graph to search. source (str): The source node. target (str): The target node.

退货

list: List of tuples (path, weight) sorted by weight descending.

rank_paths_to_term(G, gene, term)[源代码]

Find and rank paths from each gene to a specified term based on total edge weight.

参数

G (networkx.Graph): The graph to search. gene (str): The source gene. term (str): The target term.

退货

list or None: List of tuples (path, weight) sorted by weight descending, or None if no paths.

enrichr_api(genes, libs)[源代码]

Main API function to perform gene enrichment analysis.

参数

genes (list): List of gene names. libs (list): List of enrichment libraries to use.

退货

tuple: (connected_path, connections) dictionaries.

class tooluniverse.EnsemblArchiveTool[源代码]

基类:BaseTool

Tool for Ensembl Archive API providing stable ID history tracking and batch ID version lookups.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl Archive API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_id_history(arguments)[源代码]

Get version history for a single Ensembl stable ID.

_batch_lookup(arguments)[源代码]

Batch lookup version histories for multiple Ensembl IDs.

class tooluniverse.EnsemblComparaTool[源代码]

基类:BaseTool

Tool for querying Ensembl Compara comparative genomics data.

Ensembl Compara contains whole-genome alignments, gene trees, and homology data for vertebrates and other eukaryotes. Supports finding orthologues (between-species homologs) and paralogues (within-species gene duplications).

Supports: orthologue search, paralogue search, gene tree retrieval.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl Compara API call.

_query(arguments)[源代码]

Route to appropriate Ensembl Compara endpoint.

_get_orthologues(arguments)[源代码]

Get orthologues for a gene across species.

_get_paralogues(arguments)[源代码]

Get within-species paralogues (gene duplicates) for a gene.

_get_gene_tree(arguments)[源代码]

Get gene tree (phylogenetic tree of homologous genes).

_collect_members(node, members, max_members=200)[源代码]

Recursively collect leaf members from gene tree.

class tooluniverse.EnsemblGetSequence[源代码]

基类:EnsemblRESTTool

Legacy: Get DNA or protein sequences. Use EnsemblRESTTool with endpoint=’/sequence/id/{id}’ instead.

__init__(tool_config)[源代码]
class tooluniverse.EnsemblGetVariants[源代码]

基类:EnsemblRESTTool

Legacy: Get variant information. Use EnsemblRESTTool with endpoint=’/overlap/region/{species}/{region}’ instead.

__init__(tool_config)[源代码]
class tooluniverse.EnsemblInfoTool[源代码]

基类:BaseTool

Tool for Ensembl info endpoints providing genome assembly metadata and species catalog.

These endpoints complement existing Ensembl tools (sequence, variation, overlap, xrefs, etc.) by providing assembly-level and species-level information needed for genomic coordinate interpretation.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl info API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_assembly_info(arguments)[源代码]

Get genome assembly metadata for a species.

_get_species_info(arguments)[源代码]

Get list of species available in Ensembl with genome info.

class tooluniverse.EnsemblLDTool[源代码]

基类:BaseTool

Tool for querying linkage disequilibrium data from Ensembl REST API.

Provides LD statistics (r2, D’) between variants using 1000 Genomes Phase 3 population data across 26 populations.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl LD API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_ld_variants(arguments)[源代码]

Get all variants in LD with a query variant in a population.

_ld_pairwise(arguments)[源代码]

Get pairwise LD statistics between two variants across populations.

class tooluniverse.EnsemblLookupGene[源代码]

基类:EnsemblRESTTool

Legacy: Lookup gene information by ID or symbol. Use EnsemblRESTTool with endpoint=’/lookup/id/{id}’ instead.

__init__(tool_config)[源代码]
class tooluniverse.EnsemblMapTool[源代码]

基类:BaseTool

Tool for Ensembl coordinate mapping operations.

Supports: - Assembly-to-assembly coordinate conversion (GRCh37 <-> GRCh38) - Protein position to genomic coordinate mapping - cDNA position to genomic coordinate mapping

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl mapping API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_assembly_map(arguments)[源代码]

Convert coordinates between genome assemblies.

_translate_coords(arguments)[源代码]

Map protein or cDNA positions to genomic coordinates.

class tooluniverse.EnsemblOverlapTool[源代码]

基类:BaseTool

Tool for querying Ensembl Overlap API.

Supports: - Get features overlapping a genomic region (genes, transcripts, regulatory) - Get features overlapping an Ensembl gene ID

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl Overlap API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_overlap_region(arguments)[源代码]

Get features overlapping a genomic region.

_overlap_gene(arguments)[源代码]

Get features overlapping an Ensembl gene ID.

class tooluniverse.EnsemblPhenotypeTool[源代码]

基类:BaseTool

Tool for querying phenotype/disease associations from Ensembl REST API.

Provides gene-phenotype, region-phenotype, and variant-phenotype lookups. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl Phenotype API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint.

_phenotype_gene(arguments)[源代码]

Get phenotype associations for a gene.

_phenotype_region(arguments)[源代码]

Get phenotype associations for a genomic region.

_phenotype_variant(arguments)[源代码]

Get phenotype associations for a variant via the variation endpoint.

class tooluniverse.EnsemblRESTTool[源代码]

基类:BaseTool

Generic Ensembl REST API tool. Handles all Ensembl endpoints based on endpoint template in JSON config. Supports path parameters (e.g., {species}, {id}) and query parameters.

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]

Combines endpoint_template (containing {xxx}) with path parameters from arguments. For example endpoint_template=”/lookup/id/{id}”, arguments={“id”:”ENSG00000139618”} → Returns “https://rest.ensembl.org/lookup/id/ENSG00000139618

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.EnsemblRegulationTool[源代码]

基类:BaseTool

Tool for querying regulatory and conservation features from Ensembl REST API.

Provides TF binding motifs, constrained elements, and binding matrices. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl Regulation API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint.

_motif_features(arguments)[源代码]

Get TF binding motif features in a genomic region.

_constrained_elements(arguments)[源代码]

Get evolutionarily constrained elements in a genomic region.

_binding_matrix(arguments)[源代码]

Get a TF binding matrix by stable ID.

class tooluniverse.EnsemblSequenceTool[源代码]

基类:BaseTool

Tool for Ensembl sequence retrieval endpoints providing DNA and protein sequences for genes, transcripts, proteins, and genomic regions.

Complements existing Ensembl tools by providing direct sequence access for specific region coordinates and protein/cDNA sequence retrieval.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl sequence API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_region_sequence(arguments)[源代码]

Get DNA sequence for a genomic region.

_get_id_sequence(arguments)[源代码]

Get sequence for an Ensembl ID (gene, transcript, or protein).

class tooluniverse.EnsemblVEPTool[源代码]

基类:BaseTool

Tool for Ensembl VEP variant annotation and Variant Recoder ID conversion.

Supports three modes: - vep_hgvs: Annotate variants using HGVS notation (e.g., BRAF:p.Val600Glu) - vep_id: Annotate variants using dbSNP rsID (e.g., rs7903146) - variant_recoder: Convert variant IDs between formats (rsID -> HGVS, SPDI)

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl VEP or Variant Recoder API call.

_query(arguments)[源代码]

Route to appropriate Ensembl endpoint based on mode.

_vep_hgvs(arguments)[源代码]

Annotate a variant using HGVS notation.

_vep_id(arguments)[源代码]

Annotate a variant using dbSNP rsID.

_variant_recoder(arguments)[源代码]

Convert variant identifiers between formats.

_format_vep_result(result)[源代码]

Format a VEP result to extract key information.

class tooluniverse.EnsemblVariationExtTool[源代码]

基类:BaseTool

Tool for querying Ensembl variant population frequencies and detailed variant info.

Supports: - Allele frequency data across gnomAD and 1000 Genomes populations - Detailed variant records with consequences, synonyms, and evidence

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl Variation API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_population_frequencies(arguments)[源代码]

Get allele frequencies across global populations.

_get_variant_detail(arguments)[源代码]

Get detailed variant information.

class tooluniverse.EnsemblXrefsTool[源代码]

基类:BaseTool

Tool for querying Ensembl cross-references API.

Supports: - Get all external database cross-references for an Ensembl ID - Filter by external database name

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Ensembl Xrefs API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_xrefs(arguments)[源代码]

Get external cross-references for an Ensembl ID.

_get_xrefs_by_symbol(arguments)[源代码]

Look up Ensembl IDs for a gene symbol via external databases.

class tooluniverse.EpiGraphDBTool[源代码]

基类:BaseRESTTool

Tool for querying the EpiGraphDB API.

Provides access to: - Mendelian Randomization (MR) results between GWAS traits - Genetic correlations between traits - Drug repurposing via genetic evidence (drugs targeting risk factor genes) - GWAS trait to EFO/disease ontology mapping - Gene druggability information via PPI network - Gene-drug associations from pharmacogenomics databases - OpenGWAS GWAS study search

Uses IEU OpenGWAS trait IDs (e.g., ‘ieu-a-2’ for BMI, ‘ieu-a-7’ for CHD). No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the EpiGraphDB API call.

_query(arguments)[源代码]

Route to the appropriate endpoint.

_get_mr(arguments)[源代码]

Get Mendelian Randomization results between exposure and outcome traits.

_get_genetic_cor(arguments)[源代码]

Get genetic correlations between a trait and other GWAS traits.

_get_drugs_risk_factors(arguments)[源代码]

Get drugs associated with a risk factor trait via genetic evidence.

_get_gwas_efo(arguments)[源代码]

Map GWAS traits to EFO (Experimental Factor Ontology) terms.

_get_disease_efo(arguments)[源代码]

Map a disease label to EFO terms and associated GWAS studies.

_search_gene(arguments)[源代码]

Search for genes in EpiGraphDB by name or Ensembl ID.

_get_gene_drugs(arguments)[源代码]

Get drug-gene associations from pharmacogenomics databases.

_search_opengwas(arguments)[源代码]

Search OpenGWAS database for GWAS studies by trait name using NLP.

class tooluniverse.EpidemiologyTool[源代码]

基类:BaseTool

Epidemiology calculator: R0, NNT, diagnostic tests, Bayes, vaccine coverage.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_r0_herd(arguments)[源代码]
_vaccine_coverage(arguments)[源代码]
_nnt(arguments)[源代码]
_diagnostic(arguments)[源代码]
_bayesian(arguments)[源代码]
class tooluniverse.EpigenomicsTool[源代码]

基类:BaseTool

Tool for epigenomics and methylation analysis across multiple databases.

Supports: - ENCODE histone ChIP-seq, methylation (WGBS/RRBS), chromatin accessibility - ENCODE annotations (cCREs, chromatin states) - GEO methylation and ChIP-seq dataset search - Ensembl regulatory features

No authentication required.

__init__(tool_config)[源代码]
_ORGANISM_ALIASES = {'fly': 'Drosophila melanogaster', 'homo sapiens': 'Homo sapiens', 'human': 'Homo sapiens', 'mouse': 'Mus musculus', 'mus musculus': 'Mus musculus', 'rat': 'Rattus norvegicus', 'worm': 'Caenorhabditis elegans', 'zebrafish': 'Danio rerio'}
run(arguments)[源代码]

Execute the epigenomics API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

Generic ENCODE search helper.

static _is_histone_mark(target)[源代码]

Return True if target looks like a histone modification (e.g. H3K27ac, H3K4me3).

Search ENCODE histone or TF ChIP-seq experiments.

Search ENCODE methylation experiments (WGBS/RRBS).

Search ENCODE chromatin accessibility experiments (ATAC-seq / DNase-seq).

Search ENCODE annotations (cCREs, chromatin states).

Search ENCODE chromatin state annotations (ChromHMM).

_geo_esearch(term, limit=20)[源代码]

Search GEO datasets via NCBI E-utilities.

_geo_esummary(ids)[源代码]

Get summary for GEO dataset IDs via NCBI E-utilities.

Search GEO for methylation array datasets.

Search GEO for ChIP-seq datasets.

_geo_dataset_details(arguments)[源代码]

Get detailed metadata for a GEO dataset.

Search GEO for RNA-seq datasets.

Search GEO for ATAC-seq datasets (chromatin accessibility).

Search ENCODE RNA-seq experiments by biosample, organism, or assay type.

_ensembl_regulatory_features(arguments)[源代码]

Get Ensembl regulatory features for a genomic region.

Search ENCODE Hi-C and intact Hi-C experiments for 3D genome data.

Search ENCODE microRNA-seq experiments.

class tooluniverse.EuHealthDeepDiveTool[源代码]

基类:BaseTool

Wrapper for the EU Health deep dive function.

You can dive:
  • explicit UUIds: uuids=[…]

  • or a topic: topic=”euhealthinfo_search_cancer”

Supported arguments:
  • uuids: Optional[List[str]]

  • topic: Optional[str]

  • limit: int

  • links_per: int

  • method: “keyword” | “embedding” | “hybrid”

  • alpha: float

  • top_k: int

  • country: Optional[str]

  • language: Optional[str]

  • term_override: Optional[str]

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.EuHealthTopicSearchTool[源代码]

基类:BaseTool

Generic wrapper for all EU Health ‘topic search’ tools.

The associated JSON config supplies:

fields.topic = “euhealthinfo_search_cancer” (for example)

Supported arguments:
  • limit: int

  • method: “keyword” | “embedding” | “hybrid”

  • alpha: float

  • top_k: int

  • country: Optional[str]

  • language: Optional[str]

  • term_override: Optional[str]

返回:

{“warning”: “…”, “results”: […]} (fallback) or

[… shaped rows …]

返回类型:

Either

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.EuroPMCAnnotationsTool[源代码]

基类:BaseTool

Tool for extracting text-mined annotations from scientific articles via the Europe PMC Annotations API.

Supports annotation types: Chemicals, Organisms, Gene Ontology, Diseases, Genes & Proteins, Accession Numbers.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Europe PMC Annotations API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint.

_fetch_annotations(article_ids, annotation_type=None, page_size=None)[源代码]

Fetch annotations from the API.

static _normalize_article_id(article_id)[源代码]

Normalize bare PMC/PMID to API format: PMC:PMC4353746 or MED:25780448.

_by_article(arguments)[源代码]

Get annotations from a single article.

_batch_by_type(arguments)[源代码]

Get annotations of a specific type from multiple articles.

_chemicals_shortcut(arguments)[源代码]

Extract chemical mentions from an article.

class tooluniverse.EuropePMCFullTextFetchTool[源代码]

基类:BaseTool

Fetch full text content for a PMC article with deterministic fallbacks and machine-readable provenance (retrieval_trace).

This tool is intended for machine consumption: it always returns a structured status payload and, when successful, includes source/format/content_type.

__init__(tool_config)[源代码]
_build_fulltext_xml_url(arguments)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.EuropePMCFullTextSnippetsTool[源代码]

基类:BaseTool

Fetch Europe PMC fullTextXML (open access) and return bounded text snippets around user-provided terms. This helps answer questions where the crucial detail is present in the full text (e.g., methods/section titles) but not necessarily in the abstract.

__init__(tool_config)[源代码]
_build_pmc_html_url(pmcid)[源代码]
_build_pmc_oai_url(pmcid)[源代码]
_build_fulltext_xml_url(arguments)[源代码]
_extract_text(xml_text)[源代码]
_extract_text_from_html(html_text)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.EuropePMCGuidelinesTool[源代码]

基类:BaseTool

Search Europe PMC for clinical guidelines. Europe PMC provides access to life science literature including guidelines.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_europepmc_guidelines(query, limit)[源代码]

Search Europe PMC for guideline publications.

_get_europepmc_abstract(pmid)[源代码]

Get abstract for a specific PMID using PubMed API.

_get_europepmc_full_content(pmid, pmcid)[源代码]

Get more detailed content from Europe PMC.

class tooluniverse.EuropePMCRESTTool[源代码]

基类:BaseTool

Generic REST tool for Europe PMC API endpoints. Supports citations, references, and other article-related endpoints.

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]

Build URL from endpoint template and arguments, applying schema defaults for missing path params.

run(arguments)[源代码]

Execute the Europe PMC REST API request.

class tooluniverse.EuropePMCStructuredFullTextTool[源代码]

基类:BaseTool

Retrieve and parse full-text XML from Europe PMC into structured sections (title, abstract, introduction, methods, results, discussion, figures, tables, references). Accepts a PMC ID or PMID (auto-resolved via the Europe PMC search API).

_SECTION_KEYWORDS: dict[str, list[str]] = {'acknowledgments': ['acknowledgments', 'acknowledgements', 'funding'], 'conclusions': ['conclusions', 'conclusion', 'summary'], 'discussion': ['discussion'], 'introduction': ['introduction', 'background', 'intro'], 'methods': ['methods', 'materials and methods', 'material and methods', 'methodology', 'experimental', 'experimental procedures', 'study design', 'patients and methods'], 'results': ['results', 'findings']}
__init__(tool_config)[源代码]
static _local(tag)[源代码]

Strip XML namespace prefix.

static _itertext(el)[源代码]

Collapse all text under el into a single whitespace-normalised string.

_resolve_pmid_to_pmcid(pmid)[源代码]

Use Europe PMC search to convert a PMID to a PMCID.

_classify_section(title_text)[源代码]

Map a section title to a canonical name, or return ‘other’.

_parse_article_xml(xml_text)[源代码]

Parse JATS/NLM article XML into structured sections.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.EuropePMCTool[源代码]

基类:BaseTool

用于在 Europe PMC 上搜索文章(包括摘要)的工具。

__init__(tool_config, base_url='https://www.ebi.ac.uk/europepmc/webservices/rest/search')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_local_name(tag)[源代码]
_extract_abstract_from_fulltext_xml(xml_text)[源代码]
_build_fulltext_xml_url(*, source_db, article_id, pmcid)[源代码]
_build_pmc_oai_url(pmcid)[源代码]

Build an NCBI PMC OAI-PMH URL to retrieve JATS XML for a PMC article.

Europe PMC fullTextXML is not always available even when an article is in PMC. The OAI endpoint provides a robust fallback for extracting full text/abstract.

_fetch_fulltext_with_trace(*, fulltext_url, pmcid, timeout=20)[源代码]
tooluniverse.ExecuteTool

ExecuteToolTool 的别名

class tooluniverse.ExecuteToolTool[源代码]

基类:BaseTool

Execute a ToolUniverse tool directly with custom arguments.

__init__(tool_config, tooluniverse=None)[源代码]
run(arguments)[源代码]

Execute a ToolUniverse tool directly with custom arguments.

参数:

arguments (dict) –

Dictionary containing: - tool_name (str): Name of the tool to execute - arguments (dict|str): Arguments to pass to the tool.

Accepts: 1) JSON object/dict: {“param1”: “value1”, “param2”: 5} 2) JSON string that parses to object:

”{“param1”: “value1”, “param2”: 5}”

返回:

Tool execution result. If result is already a dict,

return as-is. If it’s a string (JSON), parse and return as dict.

返回类型:

dict or str

class tooluniverse.ExpressionAtlasTool[源代码]

基类:BaseTool

Tool for querying EBI Expression Atlas gene expression data.

Provides access to: - Baseline gene expression across tissues and cell types - Differential expression in disease and treatment contexts - Experiment search and metadata - Both bulk RNA-seq and single-cell data

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Expression Atlas API call.

_get_baseline_expression(arguments)[源代码]

Get baseline expression experiments for a gene.

Uses EBI Search to find experiments mentioning the gene, then filters the Expression Atlas experiment catalog for baseline experiments in the specified species.

_search_differential_experiments(arguments)[源代码]

Search for differential expression experiments by gene and/or condition.

_search_experiments(arguments)[源代码]

Search Expression Atlas experiments by gene and/or condition.

Uses EBI Search for gene-specific queries and filters the full experiment catalog by species and condition text.

_get_experiment(arguments)[源代码]

Get detailed metadata for a specific Expression Atlas experiment.

Returns experiment design, assays, and analysis information.

class tooluniverse.FAERSAnalyticsTool[源代码]

基类:BaseTool

FAERS Analytics Tool for statistical signal detection in adverse event data.

Provides: - Disproportionality analysis (ROR, PRR, IC, EBGM) - Demographic stratification - Serious event filtering - Drug comparison - Temporal trend analysis - MedDRA hierarchy rollups

__init__(tool_config)[源代码]
run(arguments)[源代码]

Route to analytics operation.

_with_data_payload(result)[源代码]

Ensure successful operation responses include a standardized data wrapper.

_calculate_disproportionality(arguments)[源代码]

Calculate disproportionality measures (ROR, PRR, IC) with 95% confidence intervals.

Uses 2x2 contingency table:

Event+ Event-

Drug+ a b Drug- c d

_stratify_by_demographics(arguments)[源代码]

Stratify adverse event data by demographics (age, sex, country).

_filter_serious_events(arguments)[源代码]

Filter for serious adverse events (death, hospitalization, disability, life-threatening).

_compare_drugs(arguments)[源代码]

Compare safety profiles of two drugs for the same adverse event.

Analyze temporal trends in adverse event reporting.

_rollup_meddra_hierarchy(arguments)[源代码]

Aggregate adverse events by MedDRA hierarchy levels (PT → HLT → SOC).

_get_faers_count(drug_name=None, adverse_event=None)[源代码]

Get count of FAERS reports matching criteria.

_get_faers_total_count()[源代码]

Get total number of reports in FAERS database.

_calculate_ror_ci(a, b, c, d)[源代码]

Calculate 95% confidence interval for ROR.

_calculate_prr_ci(a, b, c, d)[源代码]

Calculate 95% confidence interval for PRR.

_calculate_ic(a, b, c, d)[源代码]

Calculate Information Component (IC).

_calculate_ic_ci(a, b, c, d)[源代码]

Calculate 95% confidence interval for IC.

class tooluniverse.FDACountAdditiveReactionsTool[源代码]

基类:FDADrugAdverseEventTool

利用 openFDA API 在一次请求中统计多个药物的不良反应事件数量。

__init__(tool_config, endpoint_url='https://api.fda.gov/drug/event.json', api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.FDADrugAdverseEventDetailTool[源代码]

基类:BaseTool

Tool for retrieving detailed adverse event reports from FAERS. Uses limit/skip parameters instead of count aggregation.

__init__(tool_config, endpoint_url='https://api.fda.gov/drug/event.json', api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

validate_enum_arguments(arguments)[源代码]

验证基于枚举的参数是否与允许的值匹配

_extract_essential_fields(report)[源代码]

Extract only essential fields from a FAERS report. Removes verbose metadata like openfda to keep output concise. Can be customized via tool_config[‘fields’][‘essential_fields’].

_extract_custom_fields(report, field_config)[源代码]

Extract fields based on custom configuration. field_config can be a list of field paths or a dict with inclusion rules.

_get_nested_value(obj, path)[源代码]

Get value from nested dict using dot notation path

_set_nested_value(obj, path, value)[源代码]

Set value in nested dict using dot notation path

_map_value(param_name, value)[源代码]
class tooluniverse.FDADrugAdverseEventTool[源代码]

基类:BaseTool

__init__(tool_config, endpoint_url='https://api.fda.gov/drug/event.json', api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

validate_enum_arguments(arguments)[源代码]

验证基于枚举的参数是否与允许的值匹配

_post_process(response, reaction_filter=None)[源代码]
_map_value(param_name, value)[源代码]
class tooluniverse.FDADrugInteractionDetailTool[源代码]

基类:BaseTool

Tool for retrieving detailed adverse event reports involving multiple drugs (drug interactions). Uses limit/skip parameters instead of count aggregation.

__init__(tool_config, endpoint_url='https://api.fda.gov/drug/event.json', api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

validate_enum_arguments(arguments)[源代码]

验证基于枚举的参数是否与允许的值匹配

_extract_essential_fields(report)[源代码]

Extract only essential fields from a FAERS report. Removes verbose metadata like openfda to keep output concise. Can be customized via tool_config[‘fields’][‘essential_fields’].

_extract_custom_fields(report, field_config)[源代码]

Extract fields based on custom configuration. field_config can be a list of field paths or a dict with inclusion rules.

_get_nested_value(obj, path)[源代码]

Get value from nested dict using dot notation path

_set_nested_value(obj, path, value)[源代码]

Set value in nested dict using dot notation path

_map_value(param_name, value)[源代码]
tooluniverse.FDADrugLabel

FDADrugLabelTool 的别名

tooluniverse.FDADrugLabelAggregated

FDADrugLabelGetDrugNamesByIndicationAggregated 的别名

class tooluniverse.FDADrugLabelFieldValueTool[源代码]

基类:BaseTool

Search the openFDA drug label dataset by specifying a single openFDA field (e.g., “openfda.generic_name”) and a corresponding field_value.

This tool is intentionally generic and does not modify any existing FDA tools.

__init__(tool_config, api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.FDADrugLabelGetDrugGenericNameTool[源代码]

基类:FDADrugLabelTool

__init__(tool_config=None, api_key=None)[源代码]
run(arguments)[源代码]

Override run to support ChEMBL ID conversion

class tooluniverse.FDADrugLabelGetDrugNamesByIndicationAggregated[源代码]

基类:FDADrugLabelTool

Enhanced version of FDA_get_drug_names_by_indication that: - Iterates through all results in batches of 100 (no limit) - Aggregates results by generic name - Returns one entry per generic name with indication and all brand names

__init__(tool_config, api_key=None)[源代码]
run(arguments)[源代码]

Run the aggregated drug names search by indication.

Iterates through all results in batches of 100, aggregates by generic name, and returns a list where each entry contains: - generic_name: The generic drug name - indication: The indication (from input) - brand_names: List of all brand names for this generic name

class tooluniverse.FDADrugLabelGetDrugNamesByIndicationStats[源代码]

基类:FDADrugLabelTool

Enhanced version using FDA count API to efficiently aggregate drug names by indication. Uses count mechanism to get brand_name and generic_name distributions without fetching full records.

__init__(tool_config, api_key=None)[源代码]
run(arguments)[源代码]

Run the aggregated drug names search using count API.

Uses count API to: 1. Get all unique generic names for the indication 2. For each generic name, get corresponding brand names 3. Return aggregated results

class tooluniverse.FDADrugLabelSearchIDTool[源代码]

基类:FDATool

__init__(tool_config=None, api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.FDADrugLabelSearchTool[源代码]

基类:FDATool

__init__(tool_config=None, api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

tooluniverse.FDADrugLabelStats

FDADrugLabelGetDrugNamesByIndicationStats 的别名

class tooluniverse.FDADrugLabelTool[源代码]

基类:FDATool

__init__(tool_config, api_key=None)[源代码]
_is_chembl_id(value)[源代码]

Check if the value looks like a ChEMBL ID

_convert_id_to_drug_name(chembl_id)[源代码]

Convert ChEMBL ID to drug name using OpenTargets API

run(arguments)[源代码]

Override run to support ChEMBL ID conversion

class tooluniverse.FDAGSRSTool[源代码]

基类:BaseTool

FDA GSRS substance lookup and search tools.

Operations:
  • search_substances: Search substances by name, UNII, InChIKey, or formula

  • get_substance: Retrieve full substance record by UNII or UUID

  • get_structure: Get structure data (SMILES, formula, InChI) by UNII

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_clean_substance(r)[源代码]

Extract key fields from a raw substance record.

_api_get(url, params=None)[源代码]

Shared HTTP GET with consistent error handling.

_search_substances(arguments)[源代码]
_get_substance(arguments)[源代码]
_get_structure(arguments)[源代码]
class tooluniverse.FDALabelTool[源代码]

基类:BaseTool

Tool for querying FDA-approved drug label (prescribing information).

Supports searching by drug name, indication, or listing drug classes. Returns official FDA clinical content: indications, dosing, contraindications, warnings, drug interactions, and adverse reactions.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_query_drug_fields(drug_name, limit)[源代码]

Search generic_name then brand_name with quoted then unquoted fallback.

Returns extracted label results on first match, or None if no results found. Quoted search finds exact matches; unquoted fallback catches salt forms (e.g., “tofacitinib” matching “TOFACITINIB CITRATE”).

_get_label(arguments)[源代码]
_list_classes(arguments)[源代码]
class tooluniverse.FDAOrangeBookTool[源代码]

基类:BaseTool

FDA Orange Book and Drugs@FDA tool for drug approval information.

Provides: - Drug approval history - Patent information - Exclusivity dates - Therapeutic equivalence (TE) codes - Generic availability - Regulatory review documents

__init__(tool_config)[源代码]
run(arguments)[源代码]

Route to operation handler.

_with_data_payload(result)[源代码]

Ensure successful operation responses include a standardized data wrapper.

_search_drug(arguments)[源代码]

Search for drugs by brand name, generic name, or application number.

_get_approval_history(arguments)[源代码]

Get approval history and submission details for an application.

_get_patent_info(arguments)[源代码]

Get patent information for a drug (Note: Full patent data requires Orange Book download).

_get_exclusivity(arguments)[源代码]

Get exclusivity information for a drug.

_check_generic_availability(arguments)[源代码]

Check if generic versions are approved/available.

_get_te_code(arguments)[源代码]

Get therapeutic equivalence (TE) code information.

_interpret_te_code(te_code)[源代码]

Interpret TE code meaning.

class tooluniverse.FDAPharmacogenomicBiomarkersTool[源代码]

基类:BaseTool

Tool to retrieve data from the FDA’s Table of Pharmacogenomic Biomarkers in Drug Labeling. Fetches the table from the FDA website and provides filtering capabilities.

FDA_URL = 'https://www.fda.gov/drugs/science-and-research-drugs/table-pharmacogenomic-biomarkers-drug-labeling'
HEADERS = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'}
run(arguments)[源代码]

Executes the tool to retrieve and filter pharmacogenomic biomarkers.

参数:

arguments (Dict[str, Any]) –

  • drug_name (str, optional): Filter by drug name (case-insensitive partial match).

  • biomarker (str, optional): Filter by biomarker (case-insensitive partial match).

  • limit (int, optional): Maximum number of results to return (default: 10).

返回:

A dictionary containing the ‘count’ and ‘results’ list.

返回类型:

Dict[str, Any]

_parse_html_table(html_content)[源代码]

Parses the HTML content to extract the biomarkers table. Uses regex/simple parsing to avoid heavy dependencies like BeautifulSoup if possible, or assumes BeautifulSoup is available in the environment (it usually is in this project).

class tooluniverse.FDATool[源代码]

基类:BaseTool

__init__(tool_config, endpoint_url, api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.FatcatMetadataParser[源代码]

基类:HTMLParser

Extract metadata from Fatcat release page meta tags.

__init__()[源代码]

Initialize and reset this instance.

If convert_charrefs is true (the default), all character references are automatically converted to the corresponding Unicode characters.

If scripting is false (the default), the content of the noscript element is parsed normally; if it’s true, it’s returned as is without being parsed.

handle_starttag(tag, attrs)[源代码]
class tooluniverse.FatcatResultParser[源代码]

基类:HTMLParser

Parse Fatcat search results from HTML.

__init__()[源代码]

Initialize and reset this instance.

If convert_charrefs is true (the default), all character references are automatically converted to the corresponding Unicode characters.

If scripting is false (the default), the content of the noscript element is parsed normally; if it’s true, it’s returned as is without being parsed.

handle_starttag(tag, attrs)[源代码]
handle_data(data)[源代码]
handle_endtag(tag)[源代码]
class tooluniverse.FatcatScholarTool[源代码]

基类:BaseTool

Search Internet Archive Scholar via Fatcat releases search.

Uses web scraping of the scholar.archive.org interface to retrieve bibliographic information about research papers and publications.

参数(参数):

query (str): Query string max_results (int): Max results (default 10, max 100)

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.FederalRegisterTool[源代码]

基类:BaseRESTTool

REST tool for Federal Register API with bracket-notation parameter mapping.

_get_param_mapping()[源代码]

Get parameter name mappings from argument names to API parameter names.

Override this in subclasses to provide custom mappings. Example: {“limit”: “rows”, “query”: “q”}

class tooluniverse.FileDownloadTool[源代码]

基类:BaseTool

Download files from HTTP/HTTPS URLs - similar to curl.

Supports: - Direct file downloads to specified or temporary locations - Binary and text file handling - Progress tracking (optional) - Cross-platform (Windows, Mac, Linux)

Expects: {“url”: “https://…”, “output_path”: “/path/to/save”} Optional: {“timeout”: seconds, “return_content”: bool} Returns: {“file_path”: “…”, “file_size”: bytes} or {“error”: “…”}

__init__(tool_config)[源代码]
run(arguments)[源代码]

Download a file from a URL.

参数:

arguments (Dict[str, Any]) – Dictionary containing: - url (str): URL to download from - output_path (str, optional): Path to save the file - timeout (int, optional): Request timeout (default: 30) - return_content (bool): Return as text (default: False) - chunk_size (int, optional): Chunk size (default: 8192) - follow_redirects (bool): Follow redirects (default: True)

返回:

Dict with file_path and file_size, or content, or error

返回类型:

Dict[str, Any]

_normalize_path(path)[源代码]

Normalize file path for cross-platform compatibility.

参数:

path (str) – File path to normalize

返回:

Normalized path

返回类型:

str

class tooluniverse.FinnGenTool[源代码]

基类:BaseTool

Tool for querying FinnGen, the Finnish population genomics study.

Provides access to phenotype metadata, variant fine-mapping regions, and regional GWAS associations for 2,470 disease endpoints from the Finnish biobank.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the FinnGen API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint.

_list_phenotypes(arguments)[源代码]

List/search FinnGen phenotypes.

_get_phenotype(arguments)[源代码]

Get details for a specific FinnGen phenotype.

_get_variant_finemapping(arguments)[源代码]

Get fine-mapping regions associated with a genomic variant.

_get_region_associations(arguments)[源代码]

Get regional association data for a phenotype in a genomic region.

class tooluniverse.FoldseekTool[源代码]

基类:BaseRESTTool

Tool for searching protein structures using Foldseek.

Supports: - Submitting PDB structures for similarity search against AlphaFold DB,

PDB, and other databases

  • Polling for job completion (async)

  • Retrieving alignment results

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Foldseek API call.

_query(arguments)[源代码]

Route to the appropriate operation.

Submit a PDB structure for similarity search and wait for results.

_get_result(arguments)[源代码]

Get results for a previously submitted Foldseek job.

_parse_results(result_data, query_id, database, max_results)[源代码]

Parse Foldseek result JSON into structured output.

class tooluniverse.FoodDataCentralTool[源代码]

基类:BaseTool

Tool for querying the USDA FoodData Central API.

FoodData Central provides comprehensive food and nutrient data including: - Food search by name/keyword - Detailed food nutrient profiles - Food listing with pagination - Multiple data types: Foundation, SR Legacy, Branded, Survey (FNDDS)

Authentication: Requires a free API key from data.gov. Rate limit: 1,000 requests per hour per IP address. Set the FDC_API_KEY environment variable, or use ‘DEMO_KEY’ for testing.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the FoodData Central API call based on the configured operation.

_make_get_request(endpoint, params=None)[源代码]

Make a GET request to FDC API with authentication.

_search_foods(arguments)[源代码]

Search for foods by keyword/query string.

_get_food_detail(arguments)[源代码]

Get detailed food information by FDC ID.

_list_foods(arguments)[源代码]

List foods in abridged format with pagination.

_get_food_nutrients(arguments)[源代码]

Get only nutrients for a food by FDC ID (detailed nutrient profile).

class tooluniverse.FourDNTool[源代码]

基类:BaseTool

4DN Data Portal API tool for accessing Hi-C and chromatin conformation data.

run(arguments)[源代码]

Execute the tool with given arguments.

Search 4DN data portal for files or experiments.

_get_file_metadata(arguments)[源代码]

Get metadata for a specific file.

_get_experiment_metadata(arguments)[源代码]

Get metadata for a specific experiment.

_download_file_url(arguments)[源代码]

Get download URL for file (requires authentication).

class tooluniverse.GBIFOccurrenceTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GBIFTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCCNVTool[源代码]

基类:object

Query copy number variation data from GDC.

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCCasesTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCClinicalDataTool[源代码]

基类:object

Get detailed clinical data for GDC/TCGA cancer cases.

_CLINICAL_FIELDS = 'case_id,submitter_id,project.project_id,project.name,primary_site,disease_type'
_FILTER_MAP = {'disease_type': 'disease_type', 'gender': 'demographic.gender', 'primary_site': 'primary_site', 'project_id': 'project.project_id', 'vital_status': 'demographic.vital_status'}
__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCFilesTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCGeneExpressionTool[源代码]

基类:object

Query gene expression files from GDC.

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCMutationFrequencyTool[源代码]

基类:object

Get mutation frequency for a gene across cancer types.

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCProjectsTool[源代码]

基类:object

List GDC projects including TCGA and TARGET cohorts.

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCSSMTool[源代码]

基类:object

Query somatic mutations from GDC/TCGA.

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GDCSurvivalTool[源代码]

基类:object

Get Kaplan-Meier survival data for GDC/TCGA cohorts.

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GEOGetDatasetInfo[源代码]

基类:GEORESTTool

Get detailed information about a specific GEO dataset.

__init__(tool_config)[源代码]
_build_params(arguments)[源代码]

Build parameters for GEO dataset info retrieval.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.GEOGetSampleInfo[源代码]

基类:GEORESTTool

Get sample information for a GEO dataset.

__init__(tool_config)[源代码]
_build_params(arguments)[源代码]

Build parameters for GEO sample info retrieval.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.GEORESTTool[源代码]

基类:NCBIEUtilsTool

GEO Database REST API tool with rate limiting. Generic wrapper for GEO API endpoints defined in expression_tools.json.

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]

Build URL for GEO API request.

_build_params(arguments)[源代码]

Build parameters for GEO API request.

_detect_database(dataset_id)[源代码]

Return the appropriate NCBI GEO database name.

For NCBI E-utilities, GEO records (GDS, GSE, GSM, GPL) are all accessed through the single gds database. The accession prefix (GDS/GSE/GSM) is used in the search term, not as the database name.

_accession_to_uid(dataset_id, db)[源代码]

Convert accession number (e.g. GSE/GDS/GSM) to numeric UID using esearch.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.GEOSearchDatasets[源代码]

基类:GEORESTTool

Search GEO datasets by various criteria.

__init__(tool_config)[源代码]
_build_params(arguments)[源代码]

Build parameters for GEO dataset search.

class tooluniverse.GINGuidelinesTool[源代码]

基类:BaseTool

Guidelines International Network (GIN) Guidelines Search Tool. Searches the global guidelines database with 6400+ guidelines from various organizations.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_gin_guidelines(query, limit)[源代码]

Search GIN guidelines via the EBM Portal.

class tooluniverse.GNPSTool[源代码]

基类:BaseTool

Tool for querying GNPS mass spectrometry spectral data.

Provides access to reference MS/MS spectra through Universal Spectrum Identifiers (USIs) for metabolomics compound identification.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the GNPS API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_get_spectrum(arguments)[源代码]

Get MS/MS spectrum by Universal Spectrum Identifier (USI).

_compare_spectra(arguments)[源代码]

Compare two spectra using USI mirror plot endpoint.

class tooluniverse.GOAPITool[源代码]

基类:BaseTool

Tool for querying the Gene Ontology (GO) REST API.

The GO API provides access to three major ontology domains: - Biological Process (BP): cellular/organismal processes - Molecular Function (MF): molecular-level activities - Cellular Component (CC): locations of gene products

Supports: GO term lookup, gene GO annotations, gene function associations.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the GO API call.

_query(arguments)[源代码]

Route to appropriate GO endpoint.

_get_term(arguments)[源代码]

Get GO term details by GO ID.

_get_gene_functions(arguments)[源代码]

Get GO annotations (functions/processes/components) for a gene.

_search_annotations(arguments)[源代码]

Search for genes annotated with a specific GO term.

class tooluniverse.GPCRdbTool[源代码]

基类:BaseTool

Tool for querying GPCRdb GPCR database.

GPCRdb provides: - GPCR protein information and classification - Structure data for GPCR crystal/cryo-EM structures - Ligand binding data - Mutation data and effects - Sequence alignments

No authentication required. Free public access.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute GPCRdb API call based on operation type.

_normalize_protein(protein)[源代码]

Resolve gene symbol (e.g. ADRB2) to GPCRdb entry name (e.g. adrb2_human).

_get_protein(arguments)[源代码]

Get detailed protein information for a GPCR.

参数:

arguments (Dict[str, Any]) – Dict containing: - protein: Protein entry name (e.g., adrb2_human) or UniProt accession

_FAMILY_NAME_TO_SLUG = {'5-hydroxytryptamine': '001_001_001', 'adhesion': '003', 'adrenergic': '001_001_003', 'adrenergic receptors': '001_001_003', 'adrenoceptor': '001_001_003', 'aminergic': '001_001', 'aminergic receptors': '001_001', 'beta-adrenergic': '001_001_003_008', 'chemokine': '001_003_002', 'chemokine receptors': '001_003_002', 'class a': '001', 'class a (rhodopsin)': '001', 'class b': '002', 'class b1': '002', 'class b2': '003', 'class c': '004', 'class f': '005', 'class t': '006', 'dopamine': '001_001_004', 'endothelin': '001_003_006', 'frizzled': '005', 'glutamate': '004', 'histamine': '001_001_005', 'lipid receptors': '001_007', 'muscarinic': '001_001_002', 'opioid': '001_003_015', 'peptide receptors': '001_003', 'purine receptors': '001_004', 'rhodopsin': '001', 'secretin': '002', 'serotonin': '001_001_001', 'taste2': '006'}
_list_proteins(arguments)[源代码]

List GPCR protein families from GPCRdb.

参数:

arguments (Dict[str, Any]) –

Dict containing: - family: GPCR family slug (e.g., ‘001’) or human-readable name

(e.g., ‘Chemokine receptors’). If provided, returns proteins in that family.

  • protein_class: Alias for family; accepts human-readable names.

Note: GPCRdb API does not support listing all proteins by species alone. Without family, returns list of protein families.

_get_structures(arguments)[源代码]

Get GPCR structure information.

参数:

arguments (Dict[str, Any]) – Dict containing: - protein: Protein entry name (e.g., adrb2_human) or gene symbol (e.g., ADRB2) — optional - state: Receptor state filter (active, inactive, intermediate)

_get_ligands(arguments)[源代码]

Get ligands associated with a GPCR.

参数:

arguments (Dict[str, Any]) – Dict containing: - protein: Protein entry name (e.g., adrb2_human) or gene symbol (e.g., ADRB2)

_get_mutations(arguments)[源代码]

Get mutation data for a GPCR.

参数:

arguments (Dict[str, Any]) – Dict containing: - protein: Protein entry name (e.g., adrb2_human) or gene symbol (e.g., ADRB2)

class tooluniverse.GProfilerTool[源代码]

基类:BaseTool

Tool for g:Profiler functional enrichment, ID conversion, and ortholog mapping.

Supports: - g:GOSt: Functional enrichment analysis (GO, KEGG, Reactome, WP, HP, MIRNA, CORUM) - g:Convert: Gene ID conversion between namespaces - g:Orth: Cross-species ortholog mapping

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the g:Profiler API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_parse_gene_list(gene_list_str)[源代码]

Parse comma-separated gene list into a list.

_enrichment(arguments)[源代码]

Perform functional enrichment analysis (g:GOSt).

_convert_ids(arguments)[源代码]

Convert gene identifiers between namespaces (g:Convert).

_find_orthologs(arguments)[源代码]

Find orthologs across species (g:Orth).

_snpense(arguments)[源代码]

Map SNP rsIDs to genes and annotate consequences (g:SNPense).

class tooluniverse.GTDBTool[源代码]

基类:BaseTool

Tool for querying the Genome Taxonomy Database (GTDB).

GTDB is a genome-based taxonomy for prokaryotes, maintained by the Ecogenomics lab at the University of Queensland.

Supported operations: - search_taxon: Search for taxa by partial name - get_species: Get species cluster details with genomes - get_taxon_info: Get taxon card info (rank, genome count, lineage) - search_genomes: Search genomes by organism name - get_genome: Get detailed genome metadata

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the GTDB API tool with given arguments.

_make_request(path, params=None)[源代码]

Make GET request to GTDB API.

_search_taxon(arguments)[源代码]

Search for taxa by partial name.

_get_species(arguments)[源代码]

Get species cluster details.

_get_taxon_info(arguments)[源代码]

Get taxon card info (rank, genome count, higher ranks).

_search_genomes(arguments)[源代码]

Search genomes by organism name.

_get_genome(arguments)[源代码]

Get detailed genome metadata by accession.

class tooluniverse.GTExEQTLTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GTExExpressionTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.GTExV2Tool[源代码]

基类:BaseTool

GTEx Portal API V2 tool for gene expression and eQTL analysis.

Provides access to: - Gene expression data (median, per-sample) - eQTL associations (single-tissue, multi-tissue) - Tissue and sample metadata - Dataset information

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the GTEx API tool with given arguments.

_get_median_gene_expression(arguments)[源代码]

Get median gene expression across tissues.

_get_gene_expression(arguments)[源代码]

Get gene expression data at sample level.

_get_tissue_sites(arguments)[源代码]

Get tissue site information.

_get_dataset_info(arguments)[源代码]

Get GTEx dataset information.

_get_eqtl_genes(arguments)[源代码]

Get eQTL genes (eGenes) with significant cis-eQTLs.

_get_single_tissue_eqtls(arguments)[源代码]

Get significant single-tissue eQTLs.

_get_multi_tissue_eqtls(arguments)[源代码]

Get multi-tissue eQTL Metasoft results.

_calculate_eqtl(arguments)[源代码]

Calculate dynamic eQTL for gene-variant pair.

_get_sample_info(arguments)[源代码]

Get sample information and metadata.

_get_top_expressed_genes(arguments)[源代码]

Get top expressed genes for a tissue.

class tooluniverse.GWASAssociationByID[源代码]

基类:GWASRESTTool

通过其ID获取特定的GWAS关联。

__init__(tool_config)[源代码]
run(arguments)[源代码]

通过ID获取关联。

class tooluniverse.GWASAssociationSearch[源代码]

基类:GWASRESTTool

根据各种条件搜索GWAS关联。

__init__(tool_config)[源代码]
run(arguments)[源代码]

使用可选筛选条件搜索关联。

class tooluniverse.GWASAssociationsForSNP[源代码]

基类:GWASRESTTool

获取特定SNP的所有关联。

__init__(tool_config)[源代码]
run(arguments)[源代码]

获取单核苷酸多态性(SNP)的关联数据。

class tooluniverse.GWASAssociationsForStudy[源代码]

基类:GWASRESTTool

获取特定研究的所有关联。

__init__(tool_config)[源代码]
run(arguments)[源代码]

获取研究的关联。

class tooluniverse.GWASAssociationsForTrait[源代码]

基类:GWASRESTTool

获取特定性状的所有关联,并按p值排序。

__init__(tool_config)[源代码]
run(arguments)[源代码]

获取某个特征的关联,并按重要性排序。

class tooluniverse.GWASGeneSearch[源代码]

基类:BaseTool

Local tool wrapper for GWAS Catalog REST API. Searches associations by gene name.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.GWASRESTTool[源代码]

基类:BaseTool

Base class for GWAS Catalog REST API tools.

__init__(tool_config)[源代码]
_make_request(endpoint, params=None)[源代码]

Make a request to the GWAS Catalog API.

_coerce_str(value)[源代码]

Return a stripped string, or None.

_coerce_int(value)[源代码]
_efo_id_from_uri_or_id(value)[源代码]

Best-effort normalize an EFO/OBA/etc identifier.

Accepts either a full URI (e.g., ‘http://www.ebi.ac.uk/efo/OBA_2050062’) or a bare ID (e.g., ‘OBA_2050062’ or ‘OBA:2050062’).

Note: The GWAS Catalog v2 REST API supports filtering by efo_id (and sometimes efo_trait) on associations/studies endpoints. Passing a full URI via efo_uri is not consistently supported; we normalize to efo_id.

_resolve_trait_to_efo_id(disease_trait)[源代码]

Resolve a disease trait name to an EFO ID.

Tries the GWAS Catalog efoTraits endpoint first, then falls back to a study-based resolution. The /v2/associations endpoint ignores the disease_trait query parameter, so we must resolve to an EFO ID.

_resolve_trait_or_error(disease_trait, efo_id)[源代码]

Resolve disease_trait to efo_id if needed.

Returns {“efo_id”: <str>} on success, or {“error”: <dict>} when resolution fails and would produce an unfiltered query. Callers check "error" in result and return result["error"].

static _empty_result_note(efo_id)[源代码]

Return a suggestion note when no associations are found for an EFO ID.

_add_empty_result_note(result, efo_id)[源代码]

Add a suggestion note to result if the data list is empty.

_extract_embedded_data(data, data_type)[源代码]

Extract data from the _embedded structure and add metadata.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.GWASSNPByID[源代码]

基类:GWASRESTTool

通过其 rs ID 获取特定的 GWAS SNP。

__init__(tool_config)[源代码]
run(arguments)[源代码]

通过 rs ID 获取 SNP。

class tooluniverse.GWASSNPSearch[源代码]

基类:GWASRESTTool

搜索 GWAS 单核苷酸多态性(SNPs)。

__init__(tool_config)[源代码]
run(arguments)[源代码]

使用可选筛选条件搜索SNP。

class tooluniverse.GWASSNPsForGene[源代码]

基类:GWASRESTTool

获取映射到特定基因的SNP。

__init__(tool_config)[源代码]
run(arguments)[源代码]

获取基因的SNPs。

class tooluniverse.GWASStudiesForTrait[源代码]

基类:GWASRESTTool

获取针对特定特征的研究,并可选择使用筛选器。

__init__(tool_config)[源代码]
run(arguments)[源代码]

获取具有可选筛选条件的性状研究。

class tooluniverse.GWASStudyByID[源代码]

基类:GWASRESTTool

通过其ID获取特定的GWAS研究。

__init__(tool_config)[源代码]
run(arguments)[源代码]

通过ID获取研究。

class tooluniverse.GWASStudySearch[源代码]

基类:GWASRESTTool

根据各种条件搜索GWAS研究。

__init__(tool_config)[源代码]
run(arguments)[源代码]

使用可选筛选条件搜索研究。

class tooluniverse.GWASSumStatsTool[源代码]

基类:BaseTool

Tool for querying EBI GWAS Summary Statistics API.

Provides full variant-level summary statistics from deposited GWAS studies, including effect sizes, p-values, and allele frequencies for specific genomic regions.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the GWAS Summary Statistics API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint.

_list_studies(arguments)[源代码]

List GWAS studies with deposited summary statistics.

_get_trait_studies(arguments)[源代码]

Get studies with summary statistics for a given EFO trait.

_get_region_associations(arguments)[源代码]

Get summary statistics for variants in a chromosomal region.

class tooluniverse.GWASVariantsForTrait[源代码]

基类:GWASRESTTool

获取与特定特性关联的所有变体。

__init__(tool_config)[源代码]
run(arguments)[源代码]

获取具有分页支持的特征变体。

class tooluniverse.GenCCTool[源代码]

基类:BaseTool

Tool for querying GenCC gene-disease validity classifications.

GenCC (Gene Curation Coalition) aggregates gene-disease validity assessments from multiple expert curators worldwide. Classifications range from Definitive to Refuted, following ClinGen gene-disease validity framework standards.

No authentication required. Data is downloaded from GenCC bulk export.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute GenCC operation.

_search_gene(arguments)[源代码]

Get gene-disease validity classifications for a gene.

参数:

arguments (Dict[str, Any]) – Dict containing: - gene_symbol: HGNC gene symbol (e.g., BRCA2, TP53) - classification: Optional filter by classification level

_search_disease(arguments)[源代码]

Find genes with validity evidence for a disease.

参数:

arguments (Dict[str, Any]) – Dict containing: - disease: Disease name or MONDO/OMIM ID to search - classification: Optional filter by classification level

_get_classifications(arguments)[源代码]

Get summary of all gene-disease validity classification levels.

Returns classification levels with counts and descriptions. Optionally filter by submitter organization.

参数:

arguments (Dict[str, Any]) – Dict containing: - submitter: Optional filter by submitting organization name

class tooluniverse.GeneOntologyTool[源代码]

基类:BaseTool

A general-purpose tool for calling the Gene Ontology (GO) API. It is configured via a dictionary that defines the specific API endpoint.

__init__(tool_config)[源代码]

Initializes the tool with a configuration.

参数:

tool_config (Dict) – A dictionary containing ‘fields’ with an ‘endpoint’.

_build_url(args)[源代码]

Builds the request URL from arguments.

_extract_data(data, extract_path)[源代码]

Extract specific data from the GO API response using custom paths.

run(arguments=None)[源代码]

Executes the API call and returns the data.

参数:

arguments (Dict[str, Any]) – Parameters for the API call.

退货

Any: The JSON data from the API or an error dictionary.

search_terms(query)[源代码]
get_term_details(id)[源代码]
get_genes_for_term(id, taxon=None, rows=None)[源代码]
get_terms_for_gene(id)[源代码]
class tooluniverse.GenomeNexusTool[源代码]

基类:BaseTool

Tool for annotating cancer variants using Genome Nexus (MSK).

Supports: - Full variant annotation (VEP + SIFT + PolyPhen + AlphaMissense + hotspots) - Cancer hotspot lookup - Canonical transcript retrieval - Coordinate-based mutation annotation

No authentication required. All coordinates in GRCh37/hg19.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Genome Nexus API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_annotate_variant(arguments)[源代码]

Annotate a variant by HGVS genomic notation.

_annotate_mutation(arguments)[源代码]

Annotate a mutation by genomic coordinates.

_format_annotation(data)[源代码]

Format a variant annotation response.

_get_cancer_hotspots(arguments)[源代码]

Get cancer hotspot data for a variant.

_get_canonical_transcript(arguments)[源代码]

Get canonical transcript for a gene.

class tooluniverse.GetSPLBySetIDTool[源代码]

基类:BaseTool

根据SPL集ID获取完整的SPL标签,返回内容支持XML或JSON格式。

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

tooluniverse.GetToolInfo

GetToolInfoTool 的别名

class tooluniverse.GetToolInfoTool[源代码]

基类:BaseTool

Get tool information with configurable detail level. Supports single or batch tool queries.

__init__(tool_config, tooluniverse=None)[源代码]
run(arguments)[源代码]

Get tool information with configurable detail level.

参数:

arguments (dict) –

Dictionary containing: - tool_names (str | list): Single tool name (string) or list of tool names - detail_level (str, optional): “description” or “full”. Default: “full”

  • ”description”: Returns only the description field (complete, not truncated)

  • ”full”: Returns complete tool definition including parameter schema

返回:

Dictionary with tool information - Single tool: Direct tool info object - Batch tools: {“tools”: […], “total_requested”: N, “total_found”: M}

返回类型:

dict

class tooluniverse.GlyGenTool[源代码]

基类:BaseTool

Tool for querying the GlyGen glycoinformatics database.

GlyGen provides access to glycan structures, glycoproteins, glycosylation sites, biosynthetic enzymes, and related publications from integrated sources including GlyTouCan, GlyConnect, UniProt, and PubMed.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the GlyGen API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_glycan_detail(arguments)[源代码]

Get detailed information about a specific glycan by GlyTouCan accession.

Search for glycans by mass range, monosaccharide count, organism, etc.

_protein_detail(arguments)[源代码]

Get glycoprotein details including glycosylation sites.

Search for glycoproteins by organism, glycosylation type, etc.

_site_detail(arguments)[源代码]

Get details about a specific glycosylation site.

class tooluniverse.GmrepoTool[源代码]

基类:BaseTool

Tool for querying the GMrepo gut microbiome database.

Supported operations: - search_species: Search gut microbiome species by name, filtering the

full species catalog. Can also filter by phenotype association count.

  • get_phenotypes: List all phenotypes/conditions with microbiome data, optionally filtered by keyword.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the GMrepo API call.

_search_species(arguments)[源代码]

Search for gut microbiome species by name.

_get_phenotypes(arguments)[源代码]

List phenotypes/conditions with gut microbiome data.

class tooluniverse.GraphQLTool[源代码]

基类:BaseTool

__init__(tool_config, endpoint_url)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

tooluniverse.GrepTools

GrepToolsTool 的别名

class tooluniverse.GrepToolsTool[源代码]

基类:BaseTool

Native grep-like pattern search for tools (simple regex, independent from Tool_Finder_Keyword).

__init__(tool_config, tooluniverse=None)[源代码]
run(arguments)[源代码]

Search tools using simple text matching or regex pattern matching.

参数:

arguments (dict) –

Dictionary containing: - pattern (str): Search pattern (text or regex) - field (str, optional): Field to search in: “name”,

”description”, “type”, “category” (default: “name”)

  • search_mode (str, optional): “text” for simple text matching or “regex” for regex (default: “text”)

  • categories (list, optional): Optional category filter

返回:

Dictionary with matching tools (name + description)

返回类型:

dict

class tooluniverse.GtoPdbRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL with path parameters and query parameters.

_search_targets_by_abbreviation_variants(query, limit)[源代码]

Feature-44A-04: When name search returns results whose names don’t contain the query (e.g., ‘PARP’ → tankyrase via PARP5 synonym), also search for numbered variants like PARP1, PARP2, PARP3 and merge results.

GtoPdb stores PARPs under full names (‘poly(ADP-ribose) polymerase 1’) but the abbreviation field has ‘PARP1’. The API name= parameter matches abbreviations, so name=PARP1 finds the right target.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.GxATool[源代码]

基类:BaseTool

Tool for EBI Gene Expression Atlas API providing access to baseline and differential gene expression experiments across tissues and conditions.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the GxA API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_list_experiments(arguments)[源代码]

List/search gene expression experiments.

_get_experiment_expression(arguments)[源代码]

Get gene expression data for a specific experiment.

_get_experiment_info(arguments)[源代码]

Get experiment metadata and factor information.

static _gene_id_matches(row, gene_id_upper)[源代码]

Check if a row matches the gene_id, handling versioned Ensembl IDs.

class tooluniverse.HALTool[源代码]

基类:BaseTool

通过其公共 API 搜索法国 HAL 开放存档。

参数:
  • query (str) – 搜索词(Lucene 语法)

  • max_results (int) – 返回的最大结果数(默认值为10,最大值为100)

__init__(tool_config, base_url='https://api.archives-ouvertes.fr/search/')[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HCATool[源代码]

基类:BaseTool

Tool for interacting with the Human Cell Atlas (HCA) Data Coordination Platform (DCP) v2 API. Allows searching for projects and retrieving file manifests.

BASE_URL = 'https://service.azul.data.humancellatlas.org'
run(arguments)[源代码]

Executes the HCA tool action.

参数:

arguments (Dict[str, Any]) – Dictionary containing the action and its parameters. Expected keys: - action (str): “search_projects” or “get_file_manifest” - organ (str, optional): Organ to filter by (for search_projects) - disease (str, optional): Disease to filter by (for search_projects) - project_id (str, optional): Project ID (for get_file_manifest) - limit (int, optional): Max results to return (default 10)

返回:

The results of the action.

返回类型:

Dict[str, Any]

search_projects(organ=None, disease=None, limit=10)[源代码]

Search for projects in the HCA DCP.

get_file_manifest(project_id, limit=10)[源代码]

Get file download links for a project.

class tooluniverse.HGNCTool[源代码]

基类:BaseTool

Tool for querying the HGNC gene nomenclature database.

HGNC provides authoritative human gene naming. Supports fetching genes by symbol, HGNC ID, or searching by various fields including name, location, and aliases.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the HGNC API call.

_query(arguments)[源代码]

Execute an HGNC query and return structured results.

_fetch(arguments, headers)[源代码]

Fetch a specific gene record by symbol or HGNC ID.

Search for genes by various criteria.

class tooluniverse.HPAGetBiologicalProcessTool[源代码]

基类:HPASearchApiTool

Get biological process information related to a gene. Get specific biological processes a gene is involved in by gene name.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HPAGetCancerPrognosticsTool[源代码]

基类:HPAJsonApiTool

Get prognostic value of a gene across various cancers. Uses the efficient JSON API to retrieve cancer prognostic data.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HPAGetComparativeExpressionTool[源代码]

基类:HPASearchApiTool

Compare gene expression levels in specific cell lines and healthy tissues. Get expression data for comparison by gene name and cell line name.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_generate_comparison_summary(cell_expr, tissue_expr)[源代码]

Generate expression level comparison summary

class tooluniverse.HPAGetContextualBiologicalProcessTool[源代码]

基类:BaseTool

Analyze a gene’s biological processes in the context of specific tissue or cell line. Enhanced with intelligent context validation and recommendation.

__init__(tool_config)[源代码]
_validate_context(context_name)[源代码]

Validate context_name and provide intelligent recommendations

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HPAGetDiseaseExpressionTool[源代码]

基类:HPASearchApiTool

Get expression data for a gene in specific diseases and tissues. Get related expression information by gene name, tissue type, and disease name.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_compare_disease_healthy(disease_expr, healthy_expr)[源代码]

Compare expression difference between disease and healthy state

class tooluniverse.HPAGetGeneJSONTool[源代码]

基类:HPAJsonApiTool

增强的旧版工具 - 使用 Ensembl 基因 ID 获取基本基因信息。现在使用高效的 JSON API 替代了搜索 API。

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HPAGetGenePageDetailsTool[源代码]

基类:HPAXmlApiTool

Get detailed information about a gene page, including images, protein expression, antibody data, etc. Get the most comprehensive data by parsing HPA’s single gene XML endpoint. Enhanced version with improved image extraction and comprehensive data parsing based on optimization plan.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_parse_gene_xml(root, ensembl_id, include_images, include_antibodies, include_expression)[源代码]

Parse gene XML data comprehensively based on actual HPA XML schema

_extract_ihc_images(root)[源代码]

Extract tissue immunohistochemistry (IHC) images based on actual HPA XML structure

_extract_if_images(root)[源代码]

Extract subcellular immunofluorescence (IF) images based on actual HPA XML structure

_extract_antibodies(root)[源代码]

Extract antibody information from actual HPA XML structure

_extract_expression_summary(root)[源代码]

Extract expression summary information from actual HPA XML structure

_extract_tissue_expression(root)[源代码]

Extract detailed tissue expression data from actual HPA XML structure

_extract_cell_line_expression(root)[源代码]

Extract cell line expression data from actual HPA XML structure

class tooluniverse.HPAGetGeneXMLTool[源代码]

基类:HPASearchApiTool

遗留工具 - 获取基因TSV格式数据(XML的替代方案)。

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HPAGetProteinInteractionsTool[源代码]

基类:HPASearchApiTool

Get protein-protein interaction partners for a gene. Uses search API to retrieve interaction data.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HPAGetRnaExpressionBySourceTool[源代码]

基类:HPASearchApiTool

Get RNA expression for a gene from specific biological sources using optimized columns parameter. This tool directly leverages the comprehensive columns table for efficient queries.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HPAGetRnaExpressionByTissueTool[源代码]

基类:HPAJsonApiTool

Query RNA expression levels for a gene in specific tissues. More precise than general tissue expression queries.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_categorize_expression(expr_value)[源代码]

Categorize expression level

class tooluniverse.HPAGetSubcellularLocationTool[源代码]

基类:HPASearchApiTool

Get annotated subcellular locations for a protein using optimized columns parameter. Uses scml (main location) and scal (additional location) columns for efficient queries.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_generate_location_summary(main_locs, add_locs)[源代码]

Generate a summary of subcellular locations

class tooluniverse.HPAJsonApiTool[源代码]

基类:BaseTool

Base class for interacting with HPA’s /{ensembl_id}.json API. More efficient for getting comprehensive gene data.

__init__(tool_config)[源代码]
_make_api_request(ensembl_id)[源代码]

Make HPA JSON API request for a specific gene

class tooluniverse.HPASearchApiTool[源代码]

基类:BaseTool

Base class for interacting with HPA’s search_download.php API. Uses HPA’s search and download API to get protein expression data.

__init__(tool_config)[源代码]
_make_api_request(search_term, columns, format_type='json')[源代码]

Make HPA API request with improved error handling

class tooluniverse.HPASearchGenesTool[源代码]

基类:HPASearchApiTool

Search for matching genes by gene name, keywords, or cell line names and return Ensembl ID list. This is the entry tool for many query workflows.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.HPASearchTool[源代码]

基类:HPASearchApiTool

Generic search tool for Human Protein Atlas.

This tool allows custom search queries and retrieval of specific columns from the Human Protein Atlas API. It provides more flexibility than the specialized tools by allowing direct access to the search API with custom parameters.

参数:
  • search_query (str) – The search term to query for (e.g., gene name, description).

  • columns (str, optional) –

    Comma-separated list of columns to retrieve. Defaults to “g,gs,gd” (Gene, Gene synonym, Gene description).

    Available columns and their specifiers: - g: Gene name - gs: Gene synonym - gd: Gene description - e: Ensembl ID - u: UniProt ID - en: Enhanced - pe: Protein existence - r: Reliability - p: Pathology - c: Cancer - pt: Protein tissue - ptm: Predicted Transmembrane - s: Subcellular location - scml: Subcellular main location - scal: Subcellular additional location - rnat: RNA tissue specificity - rnats: RNA tissue specific score - rnatsm: RNA tissue specific nTPM - rnablm: RNA blood lineage specific nTPM - rnabrm: RNA brain region specific nTPM - rnascm: RNA single cell type specific nTPM

    See HPA API documentation for the full list of over 40 available columns.

  • format (str, optional) – Response format, “json” or “tsv”. Defaults to “json”.

返回:

A dictionary containing the search results.

If successful, returns the API response (list of entries). If failed, returns a dictionary with an “error” key.

返回类型:

dict

示例

>>> tool = HPASearchTool()
>>> result = tool.run({
...     "search_query": "p53",
...     "columns": "g,gs,scml,rnat",
...     "format": "json"
... })
>>> print(result[0]["Gene"])
TP53
run(arguments)[源代码]

Execute the search tool.

参数:

arguments (Dict[str, Any]) – Dictionary containing: - search_query (str): The term to search for. - columns (str, optional): Columns to retrieve. - format (str, optional): Response format.

返回:

Search results or error message.

返回类型:

Dict[str, Any]

class tooluniverse.HPAXmlApiTool[源代码]

基类:BaseTool

Base class for interacting with HPA’s /{ensembl_id}.xml API. Optimized for comprehensive XML data extraction.

__init__(tool_config)[源代码]
_make_api_request(ensembl_id)[源代码]

Make HPA XML API request for a specific gene

class tooluniverse.HPOTool[源代码]

基类:BaseTool

Tool for querying the Human Phenotype Ontology (HPO) at JAX.

HPO provides structured phenotype terms used in clinical genetics, rare disease research, and differential diagnosis. Each term has definitions, synonyms, cross-references, and hierarchical relationships.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the HPO API call.

_query(arguments)[源代码]

Route to appropriate HPO endpoint.

_get_term(arguments)[源代码]

Get detailed information about an HPO term by its ID.

_search_terms(arguments)[源代码]

Search for HPO terms by keyword.

_get_term_hierarchy(arguments)[源代码]

Get parent and child terms in the HPO hierarchy.

class tooluniverse.HarmonizomeTool[源代码]

基类:BaseTool

Tool for querying Harmonizome gene and dataset information.

Supports: - Gene details (symbol, name, description, synonyms, proteins) - Dataset catalog (100+ integrated genomics datasets)

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Harmonizome API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_gene(arguments)[源代码]

Get gene details from Harmonizome.

_list_datasets(arguments)[源代码]

List all available Harmonizome datasets.

_get_dataset(arguments)[源代码]

Get detailed information about a specific Harmonizome dataset.

Search Harmonizome for genes, datasets, or attributes by keyword.

_search_genes(arguments)[源代码]

Search for genes by keyword in Harmonizome.

class tooluniverse.HealthDisparitiesTool[源代码]

基类:BaseTool

Health disparities data information tool.

__init__(tool_config)[源代码]
_get_svi_info(arguments)[源代码]

Get SVI data source information.

_get_county_rankings_info(arguments)[源代码]

Get County Health Rankings information.

run(arguments)[源代码]

Execute the health disparities tool.

class tooluniverse.HocomocoTool[源代码]

基类:BaseTool

Tool for querying HOCOMOCO v14 transcription factor binding motif database.

Supported operations: - search_motifs: Search for TF motifs by gene/protein name - get_motif: Get detailed motif information including PWM and quality

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the HOCOMOCO API call.

_search_motifs(arguments)[源代码]

Search for TF motifs by gene/protein name.

_fetch_motif_summary(motif_id)[源代码]

Fetch summary info for a single motif.

_get_motif(arguments)[源代码]

Get detailed motif information including PWM.

class tooluniverse.HuBMAPTool[源代码]

基类:BaseTool

Tool for querying HuBMAP datasets, organs, and dataset details.

Supports searching published human tissue datasets by organ, assay type, and free text; listing available organs; and getting dataset metadata.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_datasets(arguments)[源代码]

Search HuBMAP datasets by organ, assay type, or free text.

_list_organs(arguments)[源代码]

List all organs available in HuBMAP.

_get_dataset(arguments)[源代码]

Get detailed metadata for a specific HuBMAP dataset.

class tooluniverse.HumanBaseTool[源代码]

基类:BaseTool

Tool to retrieve protein-protein interactions and biological processes from HumanBase.

__init__(tool_config)[源代码]
run(arguments)[源代码]

工具的主要入口点。

get_official_gene_name(gene_name)[源代码]

Retrieve the official gene symbol for a given gene name or synonym using the MyGene.info API.

参数

gene_name (str): The gene name or synonym to query.

退货

str: The official gene symbol if found; otherwise, an error message string.

get_entrez_ids(gene_names)[源代码]

Convert gene names to Entrez IDs using NCBI Entrez API.

参数

gene_names (list): List of gene names to convert.

退货

list: List of Entrez IDs corresponding to the gene names.

humanbase_ppi_retrieve(genes, tissue, max_node=10, interaction=None)[源代码]

Retrieve protein-protein interactions and biological processes from HumanBase.

参数

genes (list): List of gene names to analyze. tissue (str): Tissue type for tissue-specific interactions. max_node (int): Maximum number of nodes to retrieve. interaction (str): Specific interaction type to filter by.

退货

tuple: (NetworkX Graph of interactions, list of biological processes)

_convert_to_string(graph, bp_collection, original_genes, tissue)[源代码]

Convert NetworkX graph and biological processes to string representation.

参数

graph (networkx.Graph): The network graph. bp_collection (list): List of biological processes. original_genes (list): Original gene list provided by user. tissue (str): Tissue type used for analysis.

退货

str: Comprehensive string representation of the network data.

_get_current_timestamp()[源代码]

Get current timestamp for the report.

class tooluniverse.ICD10Tool[源代码]

基类:BaseTool

Tool for ICD-10-CM codes using external API.

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]

Build the full URL from endpoint template and arguments.

_make_request(arguments)[源代码]

Make request to ICD-10 API (NLM Clinical Tables).

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.ICDTool[源代码]

基类:BaseTool

WHO ICD-11 API tool for disease classification and coding.

__init__(tool_config)[源代码]
_get_access_token()[源代码]

Get OAuth2 access token for ICD API (cached until near expiry).

_PLACEHOLDER_KEYS = {'{code}': 'code', '{entity_id}': 'entity_id', '{linearization}': 'linearization'}
_build_url(arguments)[源代码]

Build the full URL from endpoint template and arguments.

_BOOL_PARAMS = ('flatResults', 'useFlexisearch')
_make_request(arguments)[源代码]

Make request to ICD API.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.ICiteSearchPublicationsTool[源代码]

基类:BaseRESTTool

Search PubMed by keyword, then enrich results with iCite citation metrics.

The iCite API only accepts PMIDs — it has no keyword search endpoint. This tool first queries PubMed eSearch, then batch-fetches iCite metrics.

_last_request_time = 0.0
_rate_limit_lock = <unlocked _thread.lock object>
PUBMED_ESEARCH = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi'
ICITE_API = 'https://icite.od.nih.gov/api/pubs'
_enforce_rate_limit()[源代码]
_search_pubmed(query, limit)[源代码]

Search PubMed eSearch and return list of PMID strings.

_fetch_icite(pmids)[源代码]

Fetch iCite metrics for a list of PMIDs.

run(arguments)[源代码]

Execute the API request.

参数:

arguments (Dict[str, Any]) – Tool arguments dictionary

返回:

Result dictionary with status, data, url, and optional error info

返回类型:

Dict[str, Any]

class tooluniverse.IDTTool[源代码]

基类:BaseTool

Tool for oligo thermodynamic analysis using the IDT OligoAnalyzer API.

BASE_URL = 'https://www.idtdna.com/calc/analyzer/home'
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the IDT OligoAnalyzer API request.

_validate_sequence(seq, param_name='sequence')[源代码]

Validate an oligonucleotide sequence. Returns (cleaned_seq, error_dict_or_None).

_analyze_oligo(arguments)[源代码]

Analyze an oligonucleotide: Tm, GC%, MW, extinction coefficient.

_check_self_dimer(arguments)[源代码]

Check for self-complementarity and homodimer formation.

class tooluniverse.IEDBPredictionTool[源代码]

基类:BaseTool

Tool for predicting peptide-MHC binding using IEDB Analysis Resource.

Supported operations: - predict_mhci: Predict MHC class I binding (CD8+ T cell epitopes) - predict_mhcii: Predict MHC class II binding (CD4+ T cell epitopes)

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_parse_tsv(text)[源代码]
_predict_mhci(arguments)[源代码]
_predict_mhcii(arguments)[源代码]
class tooluniverse.IEDBTool[源代码]

基类:BaseTool

Tool for interacting with the IEDB Query API (PostgREST).

This tool is JSON-config driven: each tool config supplies fields.endpoint and (optionally) fields.default_params + fields.shorthand_filters to map friendly arguments into PostgREST filter expressions (e.g., eq.123, ilike.*KVF*).

QUERY_API_URL = 'https://query-api.iedb.org'
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.IGSRTool[源代码]

基类:BaseTool

Tool for querying the International Genome Sample Resource (1000 Genomes).

Provides access to population, sample, and data collection metadata from the 1000 Genomes Project and related studies.

Supported operations: - search_populations: Search/list populations with superpopulation filtering - search_samples: Search samples by population, data collection - list_data_collections: List available data collections/studies

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the IGSR API tool with given arguments.

Execute an Elasticsearch search against IGSR API.

_search_populations(arguments)[源代码]

Search 1000 Genomes populations by superpopulation or name.

_search_samples(arguments)[源代码]

Search 1000 Genomes samples by population or data collection.

_list_data_collections(arguments)[源代码]

List available 1000 Genomes data collections and studies.

class tooluniverse.IMGTTool[源代码]

基类:BaseTool

Tool for accessing IMGT immunoglobulin/TCR data.

IMGT provides: - Immunoglobulin gene sequences - T cell receptor sequences - MHC/HLA sequences - Germline gene assignments

Uses EBI DBFetch for sequence retrieval. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute IMGT query based on operation type.

_get_sequence(arguments)[源代码]

Get immunoglobulin/TCR sequence by accession.

参数:

arguments (Dict[str, Any]) – Dict containing: - accession: IMGT/LIGM-DB accession or EMBL/GenBank accession - format: Output format (fasta, embl). Default: fasta

_search_genes(arguments)[源代码]

Search IMGT for immunoglobulin/TCR genes.

参数:

arguments (Dict[str, Any]) – Dict containing: - query: Search query (gene name, species) - gene_type: Gene type filter (IGHV, IGKV, IGLV, TRAV, TRBV, etc.) - species: Species filter (e.g., Homo sapiens)

_get_gene_info(arguments)[源代码]

Get information about IMGT gene nomenclature and databases.

参数:

arguments (Dict[str, Any]) – Dict (no required parameters)

class tooluniverse.IMPCTool[源代码]

基类:BaseTool

Tool for querying IMPC mouse phenotyping data via Solr API.

Provides access to: - Gene information and phenotyping status - Mouse knockout phenotype associations (MP terms) - Statistical results from standardized phenotyping - Viability and fertility data

No authentication required. Data freely available (CC-BY 4.0).

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the IMPC API call.

_solr_query(core, query, rows=50, fields=None, filter_query=None)[源代码]

Execute a Solr query against an IMPC core.

_get_gene_summary(arguments)[源代码]

Get gene summary from IMPC including phenotyping status, viability, and basic info.

Queries the ‘gene’ core for a given gene symbol.

_get_phenotypes_by_gene(arguments)[源代码]

Get all phenotype annotations for a gene from IMPC knockout mice.

Queries the ‘genotype-phenotype’ core for significant phenotype calls.

_search_genes(arguments)[源代码]

Search IMPC for genes matching a query string.

Useful for finding MGI IDs from gene symbols or partial names.

_get_gene_phenotype_hits(arguments)[源代码]

Get statistical results for a gene including p-values and effect sizes.

Queries the ‘statistical-result’ core for detailed phenotyping statistics.

class tooluniverse.INDRADBTool[源代码]

基类:BaseTool

Tool for querying the INDRA Database of biological statements.

Provides literature-mined statements about: - Activation / Inhibition relationships - Phosphorylation and other modifications - Complex formation - Increase/Decrease Amount Each statement includes evidence with source text and PubMed IDs.

STATEMENT_TYPES = ['Activation', 'Inhibition', 'Phosphorylation', 'Dephosphorylation', 'Ubiquitination', 'Deubiquitination', 'Acetylation', 'Deacetylation', 'IncreaseAmount', 'DecreaseAmount', 'Complex', 'Translocation', 'Autophosphorylation']
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute INDRA DB API call based on operation type.

_get_statements(arguments)[源代码]

Get biological statements for an agent (gene/protein/chemical).

_get_evidence_count(arguments)[源代码]

Get total evidence count for an agent without fetching full statements.

_get_statement_by_hash(arguments)[源代码]

Get a specific statement by its hash with full evidence.

class tooluniverse.INaturalistTool[源代码]

基类:BaseTool

Tool for querying iNaturalist biodiversity data.

iNaturalist aggregates citizen science observations from around the world. Research-grade observations are community-verified and used in scientific research. Covers all kingdoms of life with over 150 million observations.

Supports: taxa search, taxon details, observation search, species counts.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the iNaturalist API call.

_query(arguments)[源代码]

Route to appropriate iNaturalist endpoint.

_search_taxa(arguments)[源代码]

Search for taxa by name.

_get_taxon(arguments)[源代码]

Get detailed taxon information by ID.

_search_observations(arguments)[源代码]

Search for species observations.

_get_species_counts(arguments)[源代码]

Get species counts for a taxon group or location.

class tooluniverse.ITISTool[源代码]

基类:BaseTool

Tool for querying the ITIS taxonomic database.

ITIS provides standardized species names, classification hierarchies, common names, and authority references. Supports search by scientific name, common name, TSN (Taxonomic Serial Number), and hierarchy retrieval.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the ITIS API call.

_query(arguments)[源代码]

Route to appropriate ITIS endpoint.

_search_scientific(arguments)[源代码]

Search for taxa by scientific name.

_search_common(arguments)[源代码]

Search for taxa by common name.

_get_hierarchy(arguments)[源代码]

Get full taxonomic hierarchy for a TSN.

_get_full_record(arguments)[源代码]

Get complete taxonomic record for a TSN.

class tooluniverse.IdentifiersOrgTool[源代码]

基类:BaseRESTTool

Tool for Identifiers.org - biological identifier resolution service.

Resolves compact identifiers (e.g., ‘uniprot:P04637’) to resource URLs and searches the namespace registry.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Identifiers.org API call.

_query(arguments)[源代码]
_resolve(arguments)[源代码]

Resolve a compact identifier to resource URLs.

_get_namespace(arguments)[源代码]

Get namespace details by prefix.

_search_namespaces(arguments)[源代码]

Search namespaces by keyword.

_list_namespaces(arguments)[源代码]

List all registered namespaces with pagination.

class tooluniverse.ImmPortTool[源代码]

基类:BaseTool

Tool for searching ImmPort, the NIAID-funded immunology database with 900+ open studies covering vaccine trials, flow cytometry, ELISPOT, RNA-seq, and clinical immunology data.

No authentication required for study search.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_studies(arguments)[源代码]

Search ImmPort studies by keyword with optional filters.

class tooluniverse.IntActRESTTool[源代码]

基类:BaseTool

IntAct REST API tool. Generic wrapper for IntAct API endpoints defined in intact_tools.json.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments

_build_params(args)[源代码]

Build query parameters for IntAct API

run(arguments)[源代码]

Execute the IntAct API call

Use EBI Search API as fallback for IntAct queries

_use_complex_web_service(arguments)[源代码]

Use IntAct Complex Web Service for complex queries

_get_complex_details(arguments)[源代码]

Get detailed information about a specific complex by complex AC

class tooluniverse.IntOGenTool[源代码]

基类:BaseTool

Tool for querying IntOGen, the cancer driver gene database.

IntOGen systematically identifies cancer driver genes using seven computational methods applied to somatic mutation data from 28,000+ tumors across 87 cancer types from 271 cohorts. It classifies genes as cancer drivers when they are identified by at least one method.

Endpoints: - get_drivers: get driver genes for a specific cancer type - get_gene_info: get driver info for a gene across cancer types - list_cohorts: list available cancer cohorts - list_cancer_types: list all cancer types

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the IntOGen query.

_query(arguments)[源代码]

Route to appropriate endpoint handler.

_get_drivers(arguments)[源代码]

Get driver genes for a specific cancer type.

Fetches the cancer type page and extracts the DriverGenes data.

_get_gene_info(arguments)[源代码]

Get driver classification for a gene across all cancer types.

Fetches the gene page and extracts GeneMethods data showing which methods detected the gene as a driver in each cancer type.

_list_cohorts(arguments)[源代码]

List available cancer cohorts with sample counts.

Fetches the main search page and extracts Release (cohort) data.

_list_cancer_types(arguments)[源代码]

List all available cancer types.

Uses the /find endpoint which provides a clean JSON list of cancer types.

class tooluniverse.InterProDomainArchTool[源代码]

基类:BaseTool

Tool for InterPro domain architecture analysis via the InterPro API.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the InterPro API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_protein_domain_architecture(arguments)[源代码]

Get Pfam domain architecture for a protein with exact positions.

_get_structures_for_domain(arguments)[源代码]

Find PDB structures containing a specific Pfam domain.

_get_clan_members(arguments)[源代码]

Get member families in a Pfam clan (superfamily).

class tooluniverse.InterProEntryTool[源代码]

基类:BaseTool

Tool for InterPro entry API providing protein-to-domain mappings and domain/family search.

Complements existing InterPro tools by offering reverse lookups (protein -> all domains) and keyword-based entry search.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the InterPro entry API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_entries_for_protein(arguments)[源代码]

Get all InterPro domain/family entries annotated on a protein.

_search_entries(arguments)[源代码]

Search InterPro entries by keyword.

class tooluniverse.InterProExtTool[源代码]

基类:BaseTool

Extended InterPro API tool for protein-by-domain queries.

Complements existing InterPro tools (get_protein_domains, search_domains, get_domain_details) by providing reverse lookup: find all proteins containing a specific domain.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the InterPro API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_proteins_by_domain(arguments)[源代码]

Get proteins containing a specific InterPro domain.

class tooluniverse.InterProRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments.

Applies schema defaults for any template placeholders not in args.

_extract_data(data, extract_path=None)[源代码]

Extract specific data from API response

run(arguments)[源代码]

Execute the InterPro API call

class tooluniverse.InterProScanTool[源代码]

基类:BaseTool

Tool for running InterProScan sequence analysis via EBI REST API.

Provides protein domain/family prediction by scanning sequences against: - Pfam - PRINTS - ProSite - SMART - Gene3D - TIGRFAM - SUPERFAMILY - CDD - PANTHER

Job-based API: Submit sequence, poll for results. Max 100 sequences per request. Results available for 7 days.

MAX_POLL_ATTEMPTS = 60
POLL_INTERVAL = 2
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the InterProScan API call.

_scan_sequence(arguments)[源代码]

Submit a protein sequence for InterProScan analysis.

Submits the job and polls for results (up to 2 minutes). For longer jobs, use get_job_status and get_job_results.

_fetch_results(job_id)[源代码]

Fetch and parse InterProScan results.

_get_job_status(arguments)[源代码]

Check the status of an InterProScan job.

Status values: RUNNING, FINISHED, FAILURE, ERROR, NOT_FOUND

_get_job_results(arguments)[源代码]

Get results for a completed InterProScan job.

Job results are available for 7 days after completion.

class tooluniverse.InterVarTool[源代码]

基类:BaseTool

InterVar: ACMG/AMP 2015 germline variant interpretation tool.

Classifies germline variants as:

Pathogenic | Likely Pathogenic | Uncertain Significance | Likely Benign | Benign

according to the ACMG/AMP 2015 standards and guidelines. Returns individual evidence criteria (PVS1, PS1-PS4, PM1-PM6, PP1-PP5, BA1, BP1-BP7, BS1-BS4) with their activation status.

Input: genomic coordinates (chr, pos, ref, alt) in hg19 or hg38. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

static _parse_variant_args(arguments)[源代码]

Parse and validate genomic variant arguments. Returns (params, error_dict_or_None).

_classify_variant(arguments)[源代码]
class tooluniverse.JASPARRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.KEGGExtTool[源代码]

基类:BaseTool

Tool for KEGG REST API extended endpoints providing gene-pathway links, pathway gene lists, and compound details.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the KEGG API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_resolve_gene_symbol(symbol, organism='hsa')[源代码]

Resolve gene symbol (e.g. TP53) to KEGG gene ID (e.g. hsa:7157).

Parses /find results and matches by exact gene symbol (case-insensitive).

_get_gene_pathways(arguments)[源代码]

Get all KEGG pathways that a gene participates in.

_get_pathway_genes(arguments)[源代码]

Get all genes in a KEGG pathway.

_get_compound(arguments)[源代码]

Get KEGG compound/metabolite details.

_list_brite(arguments)[源代码]

List all available KEGG BRITE hierarchy classifications.

_get_brite_hierarchy(arguments)[源代码]

Get a specific KEGG BRITE hierarchy as a JSON tree.

_search_disease(arguments)[源代码]

Search KEGG disease database by keyword.

_get_disease(arguments)[源代码]

Get detailed KEGG disease information.

_get_disease_genes(arguments)[源代码]

Get genes linked to a KEGG disease.

_search_drug(arguments)[源代码]

Search KEGG drug database by keyword.

_get_drug(arguments)[源代码]

Get detailed KEGG drug information.

_get_drug_targets(arguments)[源代码]

Get gene targets linked to a KEGG drug.

_search_network(arguments)[源代码]

Search KEGG NETWORK database by keyword.

_get_network(arguments)[源代码]

Get detailed KEGG network information.

_search_variant(arguments)[源代码]

Search KEGG VARIANT database by gene name.

_get_variant(arguments)[源代码]

Get detailed KEGG variant information.

_conv_ids(arguments)[源代码]

Convert between KEGG identifiers and external database IDs.

The KEGG /conv endpoint maps KEGG gene IDs to/from external databases: ncbi-geneid, ncbi-proteinid, uniprot, chebi, pubchem.

Find cross-references between KEGG databases.

The KEGG /link endpoint finds entries linked between databases, e.g., all pathways linked to a given gene, or all drugs for a disease.

class tooluniverse.KEGGFindGenes[源代码]

基类:KEGGRESTTool

Find genes by keyword in KEGG database.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Find genes with keyword, optionally filtered by organism.

class tooluniverse.KEGGGetGeneInfo[源代码]

基类:KEGGRESTTool

Get detailed gene information by gene ID.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Get gene information.

class tooluniverse.KEGGGetPathwayInfo[源代码]

基类:KEGGRESTTool

Get detailed pathway information by pathway ID.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Get pathway information.

class tooluniverse.KEGGListOrganisms[源代码]

基类:KEGGRESTTool

List available organisms in KEGG database.

__init__(tool_config)[源代码]
run(arguments)[源代码]

List organisms.

class tooluniverse.KEGGRESTTool[源代码]

基类:BaseTool

Base class for KEGG REST API tools.

__init__(tool_config)[源代码]
_make_request(endpoint, params=None)[源代码]

Make a request to the KEGG API.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.KEGGSearchPathway[源代码]

基类:KEGGRESTTool

Search KEGG pathways by keyword.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Search pathways with keyword.

class tooluniverse.L1000FWDTool[源代码]

基类:BaseTool

Tool for querying the L1000FWD Connectivity Map API.

Provides access to: - Signature search: find L1000 signatures similar or opposite to a user gene set

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the L1000FWD tool with given arguments.

Search L1000 signatures similar or opposite to a gene expression signature.

class tooluniverse.LINCSSignatureTool[源代码]

基类:BaseTool

Tool for querying LINCS SigCom drug perturbation signatures.

Supports: search_signatures (find signatures by drug/perturbagen), list_libraries (browse available signature libraries).

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the LINCS API call.

_query(arguments)[源代码]

Route to the appropriate LINCS endpoint.

_search_signatures(arguments)[源代码]

Search LINCS signatures by drug/perturbagen name.

_list_libraries(arguments)[源代码]

List available LINCS signature libraries.

class tooluniverse.LOINCTool[源代码]

基类:BaseTool

LOINC tool for lab tests, code details, answer lists, and clinical forms.

__init__(tool_config)[源代码]
_make_request(endpoint, params)[源代码]

Make a request to the LOINC Clinical Tables API.

static _is_api_error(api_response)[源代码]

Check if an API response is an error dict.

_parse_search_results(api_response, fields)[源代码]

Parse the Clinical Tables response: [total_count, codes, extra_info, data].

_search_loinc_items(arguments)[源代码]

Search LOINC lab tests and observations by name or keywords.

_get_code_details(arguments)[源代码]

Get detailed information for a specific LOINC code.

_get_answer_list(arguments)[源代码]

Search for LOINC answer-type codes matching a search term.

_search_forms(arguments)[源代码]

Search LOINC forms and survey instruments (e.g., PHQ-9, GAD-7).

_OPERATION_MAP = {'get_answer_list': '_get_answer_list', 'get_code_details': '_get_code_details', 'search_forms': '_search_forms', 'search_tests': '_search_loinc_items'}
run(arguments)[源代码]

Execute the LOINC tool based on the operation derived from tool config name.

class tooluniverse.LOVDTool[源代码]

基类:BaseTool

Tool for querying LOVD (Leiden Open Variation Database) REST API.

LOVD provides curated variant data including: - Gene information (symbol, chromosomal location, RefSeq, curators) - Variant details (DNA/RNA/protein notation, genomic position) - Variant search by DBID or HGVS DNA notation

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the LOVD API call.

_make_request(url, params=None)[源代码]

Make a GET request with JSON format parameter.

_get_gene(arguments)[源代码]

Get gene information from LOVD by gene symbol.

Returns gene details including HGNC ID, Entrez ID, chromosome location, RefSeq transcripts, and curation information.

_get_variants(arguments)[源代码]

Get variants for a gene from LOVD.

Returns all curated variants including DNA/RNA/protein notation, genomic positions, and reporting counts. Use search_variants for filtered queries.

_search_variants(arguments)[源代码]

Search variants in LOVD by DBID or DNA notation.

Supports searching by: - Variant DBID (e.g., TP53_010464) - DNA notation without RefSeq prefix (e.g., c.*2609C>A)

class tooluniverse.LipidMapsTool[源代码]

基类:BaseTool

Tool for querying LIPID MAPS Structure Database REST API.

LIPID MAPS provides comprehensive lipidomics data including: - Lipid structure information (LMSD - LIPID MAPS Structure Database) - Lipid-related gene information (LMPD - LIPID MAPS Proteome Database) - Lipid-related protein information - Mass spectrometry m/z search

No authentication required. Free for academic/research use.

URL Pattern: /rest/{context}/{input_item}/{input_value}/{output_item}/{output_format}

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the LIPID MAPS API call based on the configured context.

_make_request(sub_path)[源代码]

Central method to handle API requests and response parsing.

_query_compound(arguments)[源代码]

Query compound/lipid information from LMSD.

_query_gene(arguments)[源代码]

Query lipid-related gene information from LMPD.

_query_protein(arguments)[源代码]

Query lipid-related protein information from LMPD.

_search_moverz(arguments)[源代码]

Search lipids by m/z value for mass spectrometry identification.

tooluniverse.ListTools

ListToolsTool 的别名

class tooluniverse.ListToolsTool[源代码]

基类:BaseTool

Unified tool listing with multiple modes.

Note: Defaults to mode=’names’ to avoid huge outputs when many tools are loaded. For getting tool descriptions or detailed information, use the ‘get_tool_info’ tool instead (supports single or batch queries), as modes like ‘basic’/’summary’ can return very large payloads.

__init__(tool_config, tooluniverse=None)[源代码]
run(arguments)[源代码]

List tools with configurable output format via mode parameter.

参数:

arguments (dict) –

Dictionary containing: - mode (str, optional, default=”names”): Output mode

  • ”names”: Return only tool names (default, recommended for large tool sets)

  • ”basic”: Return name + description (warning: can return very large payloads)

  • ”categories”: Return category statistics

  • ”by_category”: Return tools grouped by category

  • ”summary”: Return name + description + type + has_parameters (warning: can return very large payloads)

  • ”custom”: Return user-specified fields

Note: For getting tool descriptions, use ‘get_tool_info’ tool instead of ‘basic’/’summary’ modes to avoid large payloads. - categories (list, optional): Filter by categories - fields (list, required for mode=”custom”): Fields to include - group_by_category (bool, optional): Group by category

(mode=”names”|”basic”|”summary”)

  • brief (bool, optional): Truncate description (mode=”basic”|”summary”)

返回:

Dictionary with tools in requested format

返回类型:

dict

class tooluniverse.MCPAutoLoaderTool[源代码]

基类:BaseTool, BaseMCPClient

一种先进的MCP工具,可自动从MCP服务器中发现并加载所有工具。它能够将发现的工具注册为独立的ToolUniverse工具,以实现无缝使用。

__init__(tool_config)[源代码]
async discover_tools()[源代码]

从MCP服务器中发现所有可用工具

async call_tool(tool_name, arguments)[源代码]

直接通过名称调用MCP工具

generate_proxy_tool_configs()[源代码]

为已发现的工具生成代理工具配置

register_tools_in_engine(engine)[源代码]

Register discovered tools using ToolUniverse public API

async auto_load_and_register(engine)[源代码]

自动发现、加载并注册所有MCP工具

run(arguments)[源代码]

自动加载工具的主运行方法

__del__()[源代码]

对象销毁时的清理

class tooluniverse.MCPClientTool[源代码]

基类:BaseTool, BaseMCPClient

一种用作MCP客户端以连接现有MCP服务器的工具。支持HTTP和WebSocket传输。

__init__(tool_config)[源代码]
async list_tools()[源代码]

从MCP服务器列出可用工具

async call_tool(name, arguments)[源代码]

在MCP服务器上调用工具

async list_resources()[源代码]

从MCP服务器列出可用资源

async read_resource(uri)[源代码]

从MCP服务器读取资源

async list_prompts()[源代码]

从 MCP 服务器列出可用的提示

async get_prompt(name, arguments=None)[源代码]

从MCP服务器获取提示

run(arguments)[源代码]

工具的主运行方法。根据“operation”参数支持不同的操作。

async _run_list_tools()[源代码]

Run list_tools operation

async _run_call_tool(arguments)[源代码]

Run call_tool operation

async _run_list_resources()[源代码]

Run list_resources operation

async _run_read_resource(arguments)[源代码]

Run read_resource operation

async _run_list_prompts()[源代码]

Run list_prompts operation

async _run_get_prompt(arguments)[源代码]

Run get_prompt operation

class tooluniverse.MCPProxyTool[源代码]

基类:MCPClientTool

A proxy tool that automatically forwards tool calls to an MCP server. This creates individual tools for each tool available on the MCP server.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Forward the call directly to the target tool on the MCP server

class tooluniverse.MCPServerDiscovery[源代码]

基类:object

Helper class to discover and create tool configurations for MCP servers.

async static discover_server_tools(server_url, transport='http')[源代码]

Discover all tools available on an MCP server and return tool configurations.

static create_mcp_tools_config(server_configs)[源代码]

Create tool configurations for multiple MCP servers.

参数:

server_configs (List[Dict[str, str]]) – List of server configurations, each containing: - server_url: URL of the MCP server - transport: ‘http’ or ‘websocket’ (optional, defaults to ‘http’) - server_name: Name prefix for tools (optional)

返回:

List of tool configurations that can be loaded into ToolUniverse

返回类型:

List[Dict[str, Any]]

class tooluniverse.MEMETool[源代码]

基类:BaseTool

Tool for motif analysis using the MEME Suite web services.

Supports three core operations: - fimo_scan: Scan sequences for known TF binding motifs - discover_motifs: De novo motif discovery with MEME - tomtom_compare: Compare motifs against known databases - list_databases: List available motif databases (local, no API call)

All operations except list_databases submit jobs to meme-suite.org and poll for results.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MEME Suite tool with given arguments.

_fimo_scan(arguments)[源代码]

Scan sequences for known TF binding motifs using FIMO.

Submits a FIMO job with inline motifs (MEME format) or database motifs, polls for completion, and returns parsed TSV results.

_discover_motifs(arguments)[源代码]

Run de novo motif discovery using MEME.

Requires multiple FASTA sequences (>= 2) as input. Discovers overrepresented sequence patterns.

_tomtom_compare(arguments)[源代码]

Compare a query motif against a database of known motifs using TOMTOM.

The query motif must be in MEME format. Compares against a selected target database (JASPAR, HOCOMOCO, etc.).

_list_databases(arguments)[源代码]

List available motif databases on MEME Suite (local data, no API call).

_extract_job_id(html)[源代码]

Extract job ID from the MEME Suite verification response.

_extract_form_error(html)[源代码]

Extract error message from a MEME Suite form error response.

_poll_job(service, job_id, max_wait=300, interval=5)[源代码]

Poll MEME Suite job status until completion.

Status values: pending, active, done, failed, expired, unknown

_get_job_error(job_id)[源代码]

Fetch error details from a failed job’s index.html.

_parse_fimo_tsv(tsv_text)[源代码]

Parse FIMO TSV output into structured hits.

_parse_tomtom_tsv(tsv_text)[源代码]

Parse TOMTOM TSV output into structured matches.

_parse_meme_text(text)[源代码]

Parse MEME text output to extract discovered motifs.

class tooluniverse.MGnifyAnalysesTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.MGnifyExpandedTool[源代码]

基类:BaseTool

Expanded tool for querying MGnify metagenomics database.

Covers genome catalog, taxonomic profiling, biome browsing, and sample metadata - extending existing study/analysis tools.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MGnify API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_genome_detail(arguments)[源代码]

Get detailed information about a MGnify genome.

Search/list MGnify genomes with optional filters.

_biome_list(arguments)[源代码]

Browse/search MGnify biome hierarchy.

_study_detail(arguments)[源代码]

Get detailed information about a specific MGnify study.

_fetch_analysis_annotations(analysis_id, annotation_type, page_size=25)[源代码]

Shared helper to fetch paginated annotations from an analysis.

_analysis_taxonomy(arguments)[源代码]

Get taxonomic composition from a MGnify analysis (SSU or LSU).

_analysis_go_terms(arguments)[源代码]

Get GO term functional annotations from a MGnify analysis.

_analysis_interpro(arguments)[源代码]

Get InterPro protein domain annotations from a MGnify analysis.

class tooluniverse.MGnifyStudiesTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.MODOMICSTool[源代码]

基类:BaseTool

Tool for querying the MODOMICS RNA modification database.

Supports: list_modifications, get_modification, search_modifications.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MODOMICS API call.

_query(arguments)[源代码]

Route to the appropriate endpoint.

_list_modifications(arguments)[源代码]

List all RNA modifications in MODOMICS.

_get_modification(arguments)[源代码]

Get details of a specific RNA modification by ID.

_search_modifications(arguments)[源代码]

Search RNA modifications by name or short name.

class tooluniverse.MPDRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.MarkItDownTool[源代码]

基类:BaseTool

MarkItDown tool for converting files to Markdown.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute MarkItDown tool.

_convert_to_markdown(arguments)[源代码]

Convert a resource described by URI to Markdown using markitdown CLI.

_download_from_url(url)[源代码]

Download content from URL to temporary file.

_handle_data_uri(data_uri)[源代码]

Handle data URI and save to temporary file.

class tooluniverse.MassIVETool[源代码]

基类:BaseTool

Tool for querying MassIVE proteomics repository via ProXI API.

Supports searching datasets and retrieving dataset details. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MassIVE API call.

_extract_all_cv_values(cv_list)[源代码]

Extract all name-value pairs from a CV-param list.

_parse_cv_groups(groups)[源代码]

Parse a list of CV-param groups into a list of name->value dicts.

_parse_dataset(raw)[源代码]

Parse a raw ProXI dataset into a cleaner format.

_search_datasets(arguments)[源代码]

Search MassIVE datasets.

_get_dataset(arguments)[源代码]

Get details for a specific MassIVE dataset.

class tooluniverse.MaveDBTool[源代码]

基类:BaseTool

Search MaveDB for variant effect score sets and retrieve details.

__init__(tool_config)[源代码]

Search MaveDB score sets by text query.

_get_score_set(params)[源代码]

Get detailed information about a specific score set by URN.

_get_variant_scores(params)[源代码]

Get variant functional scores from a score set (CSV endpoint).

_search_experiments(params)[源代码]

Search MaveDB experiments by text query.

run(params)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.MculeTool[源代码]

基类:BaseTool

Tool for querying the Mcule compound purchasing platform.

Mcule is a compound vendor aggregator with 30M+ purchasable molecules. It provides compound lookup, property data, and database file access.

Supported operations: - lookup_compound: Look up compounds by SMILES, InChIKey, or Mcule ID - get_compound: Get detailed compound info (properties, formula, CAS) - list_databases: List available compound database files - get_database: Get detail for a specific database file

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Mcule API tool with given arguments.

_make_request(path, params=None, method='GET')[源代码]

Make request to Mcule API.

_lookup_compound(arguments)[源代码]

Look up compounds by SMILES, InChIKey, or Mcule ID.

Uses the /search/lookup/ endpoint which accepts any of: - SMILES string (e.g., CC(=O)Oc1ccccc1C(=O)O) - InChIKey (e.g., BSYNRYMUTXBXSQ-UHFFFAOYSA-N) - Mcule ID (e.g., MCULE-3199019536)

_get_compound(arguments)[源代码]

Get detailed compound information by Mcule ID.

Returns SMILES, InChIKey, formula, molecular properties, CAS numbers, and stereo type.

_list_databases(arguments)[源代码]

List available compound database files from Mcule.

Returns database name, description, entry count, last updated date, and downloadable file information.

_get_database(arguments)[源代码]

Get detail for a specific database file by ID.

Returns database name, description, entry count, last updated, and file download links.

class tooluniverse.MeSHTool[源代码]

基类:BaseTool

Tool for querying NLM’s MeSH (Medical Subject Headings) vocabulary.

MeSH is the authoritative vocabulary for biomedical indexing, used by PubMed to categorize literature. Supports descriptor lookup, term search, and hierarchical tree browsing.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MeSH API call.

_query(arguments)[源代码]

Route to appropriate MeSH endpoint.

_search_descriptors(arguments)[源代码]

Search MeSH descriptors (main headings) by label.

_get_descriptor(arguments)[源代码]

Get detailed information for a MeSH descriptor by its ID.

_search_terms(arguments)[源代码]

Search MeSH terms (entry terms/synonyms) by label.

class tooluniverse.MedGenTool[源代码]

基类:BaseRESTTool

Tool for querying the NCBI MedGen database.

Provides access to: - Search for genetic conditions/diseases - Get detailed condition summaries (definition, synonyms, genes, HPO features) - Map conditions to OMIM, Orphanet, SNOMED CT identifiers

Uses NCBI E-utilities. No authentication required.

__init__(tool_config)[源代码]
_ncbi_get(url, params)[源代码]

Rate-limited GET request to NCBI E-utilities.

run(arguments)[源代码]

Execute the MedGen API call.

_query(arguments)[源代码]

Route to the appropriate operation.

Search MedGen for genetic conditions by name or keyword.

_get_condition(arguments)[源代码]
_get_clinical_features(arguments)[源代码]

Get HPO clinical features associated with a MedGen condition.

_extract_omim(concept_meta)[源代码]

Extract OMIM IDs from conceptmeta XML.

_extract_genes(concept_meta)[源代码]

Extract associated genes from conceptmeta XML.

_extract_synonyms(concept_meta)[源代码]

Extract synonym names from conceptmeta XML.

_extract_clinical_features_from_meta(concept_meta)[源代码]

Extract clinical features from conceptmeta XML.

_extract_inheritance(concept_meta)[源代码]

Extract modes of inheritance from conceptmeta XML.

class tooluniverse.MedlinePlusRESTTool[源代码]

基类:BaseTool

MedlinePlus REST API 工具类。支持健康主题搜索、代码查询、遗传信息检索等功能。

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]

构建完整的 URL

_extract_text_content(text_item)[源代码]

从文本项中提取内容

_format_response(response, tool_name)[源代码]

Format response content

run(arguments)[源代码]

执行工具调用

search_topics_by_keyword(term, db, rettype='brief')[源代码]
connect_lookup_by_code(cs, c, dn=None, language='en', format='json')[源代码]
get_genetics_condition_by_name(condition, format='json')[源代码]
get_genetics_gene_by_name(gene, format='json')[源代码]
get_genetics_index()[源代码]
class tooluniverse.MetaCycTool[源代码]

基类:BaseTool

Tool for querying MetaCyc metabolic pathway database.

MetaCyc provides: - Experimentally elucidated metabolic pathways - Enzymes and reactions - Metabolites and compounds - Pathway diagrams

Uses BioCyc web services API. No authentication required for basic access.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute MetaCyc query based on operation type.

_fetch_biocyc_xml(object_id)[源代码]

Fetch BioCyc XML for a MetaCyc object using the web services API.

Feature-84B-004/005: biocyc.org/getxml?META=ID returns HTML (wrong). websvc.biocyc.org/getxml?id=META:ID returns XML (correct). Returns “AUTH_REQUIRED” if BioCyc redirects to account-required page.

_parse_xml_field(xml, tag)[源代码]

Extract the text content of the first matching XML tag.

_parse_xml_frameids(xml)[源代码]

Extract all frameid attribute values from an XML document.

_search_pathways(arguments)[源代码]

Search MetaCyc for pathways.

参数:

arguments (Dict[str, Any]) – Dict containing: - query: Search query (pathway name or keyword)

_get_pathway(arguments)[源代码]

Get pathway details by MetaCyc pathway ID.

参数:

arguments (Dict[str, Any]) – Dict containing: - pathway_id: MetaCyc pathway ID (e.g., PWY-5177)

_get_compound(arguments)[源代码]

Get compound details from MetaCyc.

参数:

arguments (Dict[str, Any]) – Dict containing: - compound_id: MetaCyc compound ID (e.g., CPD-1)

_get_reaction(arguments)[源代码]

Get reaction details from MetaCyc.

参数:

arguments (Dict[str, Any]) – Dict containing: - reaction_id: MetaCyc reaction ID (e.g., RXN-14500)

class tooluniverse.MetaboAnalystTool[源代码]

基类:BaseTool

Metabolomics analysis tool providing metabolite name mapping, pathway enrichment, pathway library listing, and biomarker set enrichment. Uses KEGG REST API + local scipy statistics.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_dispatch(arguments)[源代码]
_kegg_find_compound(name)[源代码]

Resolve a metabolite name to (KEGG compound ID, matched name). Returns the first exact-ish hit or None.

_kegg_get_compound_info(compound_id)[源代码]

Get compound detail from KEGG (name, formula, exact mass, etc.).

Parse DBLINKS section from KEGG flat-file format.

_kegg_list_pathways(organism)[源代码]

List all KEGG pathways for an organism.

_kegg_get_pathway_compounds(pathway_map_id)[源代码]

Get KEGG compound IDs in a pathway (using map prefix).

_pathway_enrichment(arguments)[源代码]
_name_to_id(arguments)[源代码]
_get_pathway_library(arguments)[源代码]
_biomarker_enrichment(arguments)[源代码]
class tooluniverse.MetaboLightsRESTTool[源代码]

基类:BaseTool

MetaboLights REST API tool. Generic wrapper for MetaboLights API endpoints defined in metabolights_tools.json.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments

_build_params(args)[源代码]

Build query parameters for MetaboLights API

_extract_samples_from_study(study_id)[源代码]

Extract sample information from study endpoint as fallback

_extract_files_from_study(study_id)[源代码]

Extract file information from study endpoint as fallback

run(arguments)[源代码]

Execute the MetaboLights API call

class tooluniverse.MetaAnalysisTool[源代码]

基类:BaseTool

Run fixed-effects or random-effects meta-analysis.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_meta_analyze(arguments)[源代码]
class tooluniverse.MetaboliteTool[源代码]

基类:BaseTool

Tool for querying metabolite data via PubChem (compound info) and CTD (disease associations). Accepts HMDB IDs, compound names, and PubChem CIDs.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_extract_identifier(arguments)[源代码]

Extract identifier from hmdb_id, compound_name, or pubchem_cid arguments.

_resolve_to_cid(identifier)[源代码]

Resolve an HMDB ID, compound name, or PubChem CID string to a CID integer. Returns None if resolution fails.

_get_properties(cid)[源代码]

Fetch Title, IUPAC name, formula, weight, SMILES, InChIKey from PubChem.

_get_synonyms(cid)[源代码]

Fetch all synonyms for a PubChem CID.

_ctd_diseases(chemical_term)[源代码]

Query CTD for curated disease associations for a chemical term.

_resolve_ctd_term(title, synonyms)[源代码]

Try multiple name variants to find a CTD match. Returns (term_used, disease_rows).

_get_info(arguments)[源代码]

Get compound info for a metabolite by HMDB ID, compound name, or PubChem CID. Returns common name, IUPAC name, formula, weight, SMILES, InChIKey.

Search for metabolites by name or molecular formula. Returns up to 10 PubChem compounds with name, formula, weight, SMILES.

_get_diseases(arguments)[源代码]

Get curated disease associations for a metabolite.

Accepts HMDB ID, compound name, or PubChem CID. Resolves to a PubChem compound, then queries CTD with multiple name variants (title, stereo-stripped, CAS number) to maximise CTD match rate.

class tooluniverse.MetabolomicsWorkbenchTool[源代码]

基类:BaseTool

Tool for querying Metabolomics Workbench REST API.

Metabolomics Workbench provides metabolomics data including: - Study metadata and experimental results - Compound/metabolite information and structures - RefMet standardized nomenclature - Mass spectrometry data searches

No authentication required. Free for academic/research use.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Metabolomics Workbench API call.

_make_request(sub_path)[源代码]

Central method to handle API requests and response validation.

_normalize_numeric_fields(data)[源代码]

Convert numeric string fields to actual numbers.

_query_study(arguments)[源代码]

Query study metadata.

_query_compound(arguments)[源代码]

Query compound information.

_query_refmet(arguments)[源代码]

Query RefMet nomenclature.

_search_moverz(arguments)[源代码]

Search by m/z value. Requires database as first URL path segment.

_search_exactmass(arguments)[源代码]

Search by exact mass using moverz endpoint with neutral adduct.

class tooluniverse.MobiDBTool[源代码]

基类:BaseTool

Tool for querying MobiDB protein disorder database.

Supports: - Get protein disorder predictions, curated regions, PTMs, binding modes - Get consensus disorder summary for a protein

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MobiDB API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_protein(arguments)[源代码]

Get comprehensive disorder data for a protein from MobiDB.

_get_consensus(arguments)[源代码]

Get consensus disorder summary for a protein.

class tooluniverse.Molecule2DTool[源代码]

基类:VisualizationTool

Tool for visualizing 2D molecular structures using RDKit.

run(arguments)[源代码]

Generate 2D molecular structure visualization.

_resolve_molecule_name(name)[源代码]

Resolve molecule name to SMILES using PubChem.

_calculate_molecular_properties(mol)[源代码]

Calculate basic molecular properties.

_create_molecule_html(mol, input_data, input_type, width, height, static_image, output_format)[源代码]

Create HTML content for molecule visualization.

class tooluniverse.Molecule3DTool[源代码]

基类:VisualizationTool

Tool for visualizing 3D molecular structures using RDKit and py3Dmol.

run(arguments)[源代码]

Generate 3D molecular structure visualization.

_calculate_molecular_properties(mol)[源代码]

Calculate basic molecular properties.

_create_molecule_html(mol, input_data, input_type, width, height, mol_props, style, color_scheme)[源代码]

Create HTML content for molecule 3D visualization.

_create_molecule_control_panel(current_style, current_color)[源代码]

Create floating control panel HTML for molecules.

_create_toolbar()[源代码]

Create bottom toolbar HTML.

_create_molecule_info_cards(input_data, mol_props)[源代码]

Create molecule information cards.

tooluniverse.Monarch

MonarchTool 的别名

tooluniverse.MonarchDiseasesForMultiplePheno

MonarchDiseasesForMultiplePhenoTool 的别名

class tooluniverse.MonarchDiseasesForMultiplePhenoTool[源代码]

基类:MonarchTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.MonarchTool[源代码]

基类:RESTfulTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.MonarchV3Tool[源代码]

基类:BaseTool

Tool for querying the Monarch Initiative V3 knowledge graph.

Monarch provides integrated data linking genes, diseases, phenotypes, and model organisms. The V3 API supports entity lookup, association queries, and cross-species phenotype comparisons. Data sources include OMIM, ClinVar, HPO, MGI, ZFIN, FlyBase, WormBase, and others.

Supports: entity lookup, phenotype associations, disease-gene associations.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Monarch V3 API call.

_query(arguments)[源代码]

Route to appropriate Monarch V3 endpoint.

_get_entity(arguments)[源代码]

Get detailed entity information by CURIE identifier.

_get_associations(arguments)[源代码]

Get associations for an entity with optional filtering by category.

Search Monarch knowledge graph for entities by name/keyword.

Search for diseases in the Mondo Disease Ontology via Monarch.

_mondo_get_disease(arguments)[源代码]

Get detailed Mondo disease information including hierarchy and cross-references.

_mondo_get_phenotypes(arguments)[源代码]

Get HPO phenotypes associated with a Mondo disease.

_histopheno(arguments)[源代码]

Get phenotype counts by body system for a disease.

_get_mappings(arguments)[源代码]

Get cross-ontology mappings for an entity.

Search for diseases matching a set of phenotypes using semantic similarity.

class tooluniverse.MutalyzerTool[源代码]

基类:BaseTool

Tool for HGVS variant nomenclature validation and normalization using the Mutalyzer API.

Supports: normalize (validate + predict protein), back_translate (protein to DNA variants), description_to_model (parse HGVS to structured model).

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Mutalyzer API call.

_query(arguments)[源代码]

Route to the appropriate Mutalyzer endpoint.

_normalize(arguments)[源代码]

Validate and normalize an HGVS variant description.

_back_translate(arguments)[源代码]

Convert a protein variant description to possible DNA-level variants.

_description_to_model(arguments)[源代码]

Parse an HGVS description into a structured model.

class tooluniverse.MyChemTool[源代码]

基类:BaseTool

Tool for querying MyChem.info API.

MyChem.info provides chemical/drug annotation data from 30+ sources for 90M+ chemicals and drugs.

No authentication required. Free for academic/research use.

MYCHEM_BASE_URL = 'https://mychem.info/v1'
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MyChem.info API call.

_query_chemicals(arguments)[源代码]

Query chemicals/drugs by name, InChIKey, or other identifiers.

Endpoint: GET /query

_get_chemical(arguments)[源代码]

Get detailed chemical annotation by InChIKey or other ID.

Endpoint: GET /chem/<chemid>

class tooluniverse.MyDiseaseTool[源代码]

基类:BaseTool

Tool for MyDisease.info BioThings API providing aggregated disease annotations from MONDO, Disease Ontology, CTD, HPO, and DisGeNET.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MyDisease.info API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_disease(arguments)[源代码]

Get comprehensive disease annotations by disease ID.

_search_diseases(arguments)[源代码]

Search diseases by keyword.

class tooluniverse.MyGeneTool[源代码]

基类:BaseTool

Tool for querying MyGene.info API.

MyGene.info provides gene annotation data from 30+ sources including Entrez Gene, Ensembl, UniProt, HGNC, and more.

No authentication required. Free for academic/research use.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MyGene.info API call.

_query_genes(arguments)[源代码]

Query genes by keyword, symbol, or other identifiers.

Endpoint: GET /query

_get_gene(arguments)[源代码]

Get detailed gene annotation by gene ID.

Endpoint: GET /gene/<geneid>

_query_batch(arguments)[源代码]

Query multiple genes at once using POST.

Endpoint: POST /query

class tooluniverse.MyVariantTool[源代码]

基类:BaseTool

Tool for querying MyVariant.info API.

MyVariant.info provides variant annotation data from 19+ sources for 400M+ human variants.

No authentication required. Free for academic/research use.

MYVARIANT_BASE_URL = 'https://myvariant.info/v1'
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the MyVariant.info API call.

_query_variants(arguments)[源代码]

Query variants by various criteria.

Endpoint: GET /query

_get_variant(arguments)[源代码]

Get detailed variant annotation by HGVS ID.

Endpoint: GET /variant/<hgvsid>

class tooluniverse.NCATool[源代码]

基类:BaseTool

Non-Compartmental Analysis (NCA) for pharmacokinetics.

Endpoints: - compute_parameters: Full NCA from time-concentration data - fit_one_compartment: 1-compartment IV bolus model fitting - calculate_bioavailability: Oral bioavailability F calculation

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_auc_trapezoid(times, concs)[源代码]

Linear-log trapezoidal AUC calculation.

Uses logarithmic trapezoid for declining phases (more accurate), linear trapezoid for ascending phases and zero concentrations.

_aumc_trapezoid(times, concs)[源代码]

Linear trapezoidal AUMC calculation (area under the first-moment curve).

AUMC = integral(t * C(t) dt). Used to compute model-independent MRT: MRT_iv = AUMC_0-inf / AUC_0-inf.

Uses the linear trapezoid rule throughout: each interval contributes dt * (t1*C1 + t2*C2) / 2. This is consistent with most NCA software (e.g., Phoenix WinNonlin uses linear AUMC with log-linear AUC).

_estimate_terminal_slope(times, concs, n_points=3, tmax=None)[源代码]

Estimate terminal elimination rate constant (λz) from log-linear regression.

Per FDA NCA guidance (2003) and Rowland & Tozer (2011), λz should be estimated from all time points in the log-linear terminal phase, which begins after Tmax. When tmax is provided, all post-Tmax positive-concentration points are used. Falls back to the last n_points if fewer than 2 post-Tmax points are available.

Returns: (lambda_z, r_squared, intercept) or (None, None, None) on failure.

_try_pk_unit_conversion(dose_val, dose_unit, conc_unit)[源代码]

Try to convert dose and concentration to standard base units (ng, ng/mL).

Returns (dose_ng, conc_factor, True) on success, or (None, None, False) for unknown units. conc_factor multiplies raw concentration to obtain ng/mL.

_compute_parameters(arguments)[源代码]

Full NCA computation from time-concentration data.

_fit_one_compartment(arguments)[源代码]

Fit 1-compartment IV bolus model: C(t) = C0 * exp(-k_el * t).

_calculate_bioavailability(arguments)[源代码]

Calculate oral bioavailability F from IV and PO AUC and dose.

class tooluniverse.NCBIBlastTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_parse_blast_results(blast_xml)[源代码]

Parse BLAST XML results into structured data

run(arguments)[源代码]

Execute BLAST search using NCBI Web service

class tooluniverse.NCBIDatasetsTool[源代码]

基类:BaseTool

Tool for querying the NCBI Datasets API v2.

Provides access to gene information by ID/symbol, gene orthologs, genome assembly reports by taxon, taxonomy details by taxon ID, and taxonomy name suggestions.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the NCBI Datasets API call.

_query(arguments)[源代码]

Route to the appropriate NCBI Datasets endpoint.

_get_gene_by_id(arguments)[源代码]

Get gene information by NCBI Gene ID.

_get_gene_by_symbol(arguments)[源代码]

Get gene information by gene symbol and taxon.

_get_gene_orthologs(arguments)[源代码]

Get orthologs for a gene by NCBI Gene ID.

_get_taxonomy(arguments)[源代码]

Get taxonomy information by NCBI Taxonomy ID.

_get_taxonomy_suggest(arguments)[源代码]

Suggest taxonomy names matching a query string.

_extract_locations(gene_data)[源代码]

Extract genomic location information from annotations.

class tooluniverse.NCBIEUtilsTool[源代码]

基类:BaseTool

Base class for NCBI E-utilities tools with rate limiting.

__init__(tool_config)[源代码]
_make_request(endpoint, params=None)[源代码]

Make request with rate limiting and retry logic.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.NCBINucleotideSearchTool[源代码]

基类:NCBIEUtilsTool

NCBI Nucleotide Database Search Tool using E-utilities. Searches GenBank/EMBL/RefSeq for DNA/RNA sequences by organism, gene, keywords.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the nucleotide search with given arguments.

_build_search_term(arguments)[源代码]

Build NCBI search term from arguments.

_search_nucleotide(arguments)[源代码]

Search NCBI nucleotide database and return UIDs. Uses esearch to find matching records.

_fetch_accession(arguments)[源代码]

Fetch accession numbers for given UIDs. Uses efetch with rettype=acc to get just accession numbers.

_fetch_sequence(arguments)[源代码]

Fetch sequence data for given accession(s). Uses efetch to retrieve sequences in specified format.

class tooluniverse.NCBISRATool[源代码]

基类:NCBIEUtilsTool

NCBI SRA Tool using E-utilities for sequencing run metadata and downloads.

_OPERATIONS = {'get_download_urls': '_get_download_urls', 'get_run_info': '_get_run_info', 'link_to_biosample': '_link_to_biosample', 'search': '_search_sra_runs'}
__init__(tool_config)[源代码]
static _normalize_accessions(arguments)[源代码]

Extract and normalize accessions from arguments, always returning a list.

run(arguments)[源代码]

Execute the SRA tool with given arguments.

_SEARCH_FIELDS = {'organism': 'Organism', 'platform': 'Platform', 'source': 'Source', 'strategy': 'Strategy', 'study': 'Study'}
_build_search_term(arguments)[源代码]

Build NCBI SRA search term from arguments.

_search_sra_runs(arguments)[源代码]

Search SRA database for runs using esearch.

_get_run_info(arguments)[源代码]

Get metadata for SRA run accessions via efetch XML.

_parse_sra_xml(xml_data)[源代码]

Parse SRA XML metadata to extract run information.

_get_download_urls(arguments)[源代码]

Get FTP, S3, and NCBI download URLs for SRA run accessions.

Link SRA runs to BioSample records via elink.

class tooluniverse.NCBIVariationTool[源代码]

基类:BaseTool

Tool for SPDI/HGVS variant notation conversion and normalization using the NCBI Variation Services API.

Supports: spdi_to_hgvs, hgvs_to_spdi, spdi_equivalents, spdi_canonical, rsid_lookup.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the NCBI Variation Services API call.

_query(arguments)[源代码]

Route to the appropriate endpoint.

_spdi_to_hgvs(arguments)[源代码]

Convert SPDI notation to HGVS.

_hgvs_to_spdi(arguments)[源代码]

Convert HGVS notation to SPDI.

_spdi_equivalents(arguments)[源代码]

Get all equivalent SPDI representations across assemblies.

_spdi_canonical(arguments)[源代码]

Get canonical representative SPDI for a variant.

_rsid_lookup(arguments)[源代码]

Look up a dbSNP rsID and return variant details.

class tooluniverse.NCCNGuidelineTool[源代码]

基类:BaseTool

National Comprehensive Cancer Network (NCCN) guideline tools.

Supports three operations: - list_patient: List NCCN Guidelines for Patients (free, scraped from nccn.org) - search: Search NCCN content via PubMed (JNCCN journal articles) - get_patient: Get content from a specific NCCN patient guideline page

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_list_patient_guidelines(arguments)[源代码]

List all NCCN Guidelines for Patients from nccn.org.

Search NCCN content via PubMed.

_get_patient_guideline(arguments)[源代码]

Get content from a specific NCCN patient guideline — scrapes detail page and extracts text directly from the PDF using pdfplumber.

class tooluniverse.NCICACTUSTool[源代码]

基类:BaseTool

Convert chemical identifiers using the NCI CACTUS resolver.

Accepts chemical names, SMILES, InChI, InChIKey, or CAS numbers as input and returns the requested representation (SMILES, IUPAC name, InChI, InChIKey, molecular formula, molecular weight, CAS number, or synonyms).

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_resolve_single(identifier, representation)[源代码]
_resolve_multiple(identifier)[源代码]
class tooluniverse.NCIThesaurusTool[源代码]

基类:BaseTool

Tool for querying the NCI Thesaurus (NCIt).

NCIt provides a rich set of cancer-related terms with definitions, synonyms, semantic types, and cross-references to ICD, SNOMED-CT, MedDRA, and CDISC. Covers ~190,000 concepts organized in a polyhierarchy.

Supports: concept search, concept details, hierarchy navigation.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the NCI Thesaurus API call.

_query(arguments)[源代码]

Route to appropriate NCI endpoint.

Search NCI Thesaurus by term.

_get_concept(arguments)[源代码]

Get detailed concept information by code.

_get_children(arguments)[源代码]

Get child concepts for a given code.

class tooluniverse.NDExTool[源代码]

基类:BaseTool

Tool for querying the NDEx biological network repository.

NDEx provides access to thousands of published biological networks including protein-protein interaction (PPI), signaling pathways, gene regulatory networks, and metabolic networks. Networks are contributed by research groups and databases like NCI-PID, SIGNOR, and individual labs.

Supports: network search, network summary, network content retrieval.

No authentication required for public networks.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the NDEx API call.

_query(arguments)[源代码]

Route to appropriate NDEx endpoint.

_search_networks(arguments)[源代码]

Search NDEx for biological networks by keyword.

_get_network_summary(arguments)[源代码]

Get summary information for a specific network by UUID.

_get_network(arguments)[源代码]

Get network content (nodes and edges) in CX format.

class tooluniverse.NEBTmTool[源代码]

基类:BaseTool

Tool for calculating primer Tm/Ta using the NEB Tm Calculator API.

BASE_URL = 'https://tmapi.neb.com'
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the NEB Tm Calculator API request.

_calculate_tm(arguments)[源代码]

Calculate Tm for one or two primer sequences.

_list_products(arguments)[源代码]

List available NEB polymerase products and their product codes.

class tooluniverse.NHANESTool[源代码]

基类:BaseTool

NHANES data information tool.

__init__(tool_config)[源代码]
_get_dataset_info(arguments)[源代码]

Get NHANES dataset information.

_search_datasets(arguments)[源代码]

Search NHANES variable list dynamically via CDC website.

Queries the actual NHANES variable catalog at wwwn.cdc.gov instead of using hardcoded keyword lists.

_CYCLE_SUFFIX = {'2011-2012': '_G', '2013-2014': '_H', '2015-2016': '_I', '2017-2018': '_J', '2019-2020': '_K'}
_COMPONENT_PREFIX = {'BodyMeasures': 'BMX', 'Demographics': 'DEMO', 'Dietary': 'DR1TOT', 'DietaryDay2': 'DR2TOT', 'Examination': 'BPX', 'Questionnaire': 'PFQ'}
_resolve_filename(component, cycle, dataset_name=None)[源代码]

Resolve component + cycle to the XPT filename (without .XPT).

_build_xpt_url(cycle, filename)[源代码]

Build the CDC download URL for an XPT file.

_download_xpt(url)[源代码]

Download and parse an XPT file from CDC. Returns a DataFrame.

static _format_age_bounds(age_min, age_max)[源代码]

Format age bounds into a human-readable string like ‘>= 60 and <= 80’.

static _filter_by_age(df, age_min, age_max)[源代码]

Filter DataFrame by RIDAGEYR bounds.

_compute_summary_stats(df)[源代码]

Compute summary statistics for numeric columns.

_download_and_parse(arguments)[源代码]

Download an NHANES XPT file, parse it, and return structured data.

run(arguments)[源代码]

Execute the NHANES tool.

class tooluniverse.NICEGuidelineFullTextTool[源代码]

基类:BaseTool

Fetch full text content from NICE guideline pages. Takes a NICE guideline URL and extracts the complete guideline content.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_fetch_full_guideline(url)[源代码]

Fetch complete guideline content from NICE page.

class tooluniverse.NICEWebScrapingTool[源代码]

基类:BaseTool

Real NICE guidelines search using web scraping. Makes actual HTTP requests to NICE website and parses HTML responses.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_fetch_guideline_summary(url)[源代码]

Fetch summary from a guideline detail page.

_search_nice_guidelines_real(query, limit)[源代码]

Search NICE guidelines using real web scraping.

class tooluniverse.NeuroMorphoTool[源代码]

基类:BaseTool

Tool for querying NeuroMorpho.Org neuron morphology database.

Provides access to: - Neuron metadata (species, brain region, cell type, etc.) - Morphometric measurements (surface area, volume, branch count) - Associated literature - Search/filtering by multiple neuron attributes

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the NeuroMorpho API call.

_get_neuron_by_id(arguments)[源代码]

Get a neuron by its numeric ID or name.

_search_neurons(arguments)[源代码]

Search neurons by field criteria.

_get_morphometry(arguments)[源代码]

Get morphometric measurements for a neuron.

_get_field_values(arguments)[源代码]

Get available values for a neuron metadata field.

class tooluniverse.NextstrainTool[源代码]

基类:BaseTool

Tool for querying Nextstrain, the pathogen evolution tracker.

Provides access to phylogenetic datasets for various pathogens including influenza, SARS-CoV-2, Zika, Ebola, Dengue, and more. Returns metadata and phylogenetic tree data.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Nextstrain API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_list_datasets(arguments)[源代码]

List available Nextstrain pathogen datasets.

_get_dataset(arguments)[源代码]

Get metadata and tree summary for a Nextstrain dataset.

class tooluniverse.NvidiaNIMTool[源代码]

基类:BaseTool

NVIDIA NIM Healthcare API tool.

Provides unified access to 16 NVIDIA cloud-hosted healthcare AI APIs:

Structure Prediction: - AlphaFold2, AlphaFold2-Multimer, ESMFold, OpenFold2, OpenFold3, Boltz2

Protein Design: - ProteinMPNN, RFdiffusion

Molecular Tools: - DiffDock, GenMol, MolMIM

Genomics: - Evo2-40B, MSA-Search, ESM2-650M

Medical Imaging: - MAISI, Vista3D

Configuration fields: - endpoint: API endpoint path (relative to base URL) - base_url: Override base URL (default: https://health.api.nvidia.com/v1/biology) - async_expected: Whether 202 async response is expected - poll_seconds: NVCF-POLL-SECONDS header value (default 300) - response_type: Expected response type (json, pdb, mfasta, zip) - timeout: Request timeout in seconds (default 600)

DEFAULT_BASE_URL = 'https://health.api.nvidia.com/v1/biology'
STATUS_URL = 'https://integrate.api.nvidia.com/v1/status'
ASSETS_URL = 'https://api.nvcf.nvidia.com/v2/nvcf/assets'
DEFAULT_TIMEOUT = 600
DEFAULT_POLL_SECONDS = 300
MAX_POLL_ATTEMPTS = 120
POLL_INTERVAL = 5
__init__(tool_config)[源代码]
_get_headers()[源代码]

Build request headers with authentication.

_build_url()[源代码]

Build the full API URL.

_poll_for_result(req_id, headers)[源代码]

Poll the status endpoint for async operation results.

参数:
  • req_id (str) – The nvcf-reqid from the 202 response

  • headers (Dict[str, str]) – Request headers including auth

返回:

Final response from the API

返回类型:

Dict[str, Any]

_parse_response(response)[源代码]

Parse API response based on response type and status.

_validate_api_key()[源代码]

Validate API key is present.

_upload_asset(content, description='diffdock-file')[源代码]

Upload a file to NVIDIA’s asset storage for tools that require staged inputs (e.g., DiffDock).

This implements the NVCF asset upload pattern: 1. POST to assets API to get an upload URL and asset ID 2. PUT the file content to the upload URL 3. Return the asset ID to be used in the main API request

参数:
  • content (str) – File content to upload (string)

  • description (str) – Description for the asset

返回:

Dictionary with ‘asset_id’ on success, or error details on failure

返回类型:

Dict[str, Any]

_handle_diffdock_staged(arguments)[源代码]

Handle DiffDock’s staged asset upload workflow.

When is_staged=True, protein and ligand should be raw content that needs to be uploaded as assets. The asset IDs are then used in the actual request.

参数:

arguments (Dict[str, Any]) – Original arguments with protein and ligand content

返回:

Modified arguments with asset IDs, or error dict on failure

返回类型:

Dict[str, Any]

run(arguments)[源代码]

Execute the NVIDIA NIM API call.

参数:

arguments (Dict[str, Any]) – Dictionary of API-specific parameters

返回:

  • status: “success” or error information

  • data: API response data

  • Additional fields based on response type

返回类型:

Dictionary containing

class tooluniverse.OBISOccurrenceTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.OBISTaxaTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.ODPHPItemList[源代码]

基类:ODPHPRESTTool

检索主题或类别列表。

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.ODPHPMyHealthfinder[源代码]

基类:ODPHPRESTTool

搜索特定人群的健康建议(MyHealthfinder)。

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.ODPHPOutlinkFetch[源代码]

基类:BaseTool

根据AccessibleVersion / RelatedItems.Url获取引用的文章页面,并返回可读文本。 - HTML:提取主要内容/文章/正文文本;移除导航栏(nav)、侧边栏(aside)、页脚(footer)、脚本(script)和样式(style)。 - PDF或非HTML:返回元数据和URL,以便代理能够显示相关内容。

__init__(tool_config)[源代码]
_extract_text(html)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.ODPHPRESTTool[源代码]

基类:BaseTool

Base class for ODPHP (MyHealthfinder) REST API tools.

__init__(tool_config)[源代码]
_make_request(params=None)[源代码]
class tooluniverse.ODPHPTopicSearch[源代码]

基类:ODPHPRESTTool

通过 ID、类别或关键词搜索健康主题。

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.OLSRESTTool[源代码]

基类:BaseTool

Generic tool for the EMBL-EBI OLS v4 REST API.

This is a JSON-config driven tool. Each tool config supplies: - fields.kind: “search” | “term” | “children” | “ontology” | “ontologies” - fields.base_url: optional override (defaults to OLS4 API root) - fields.ontology_id: optional ontology scope (e.g., “efo”)

DEFAULT_BASE_URL = 'https://www.ebi.ac.uk/ols4/api'
static _double_urlencode(value)[源代码]
static _obo_id_to_efo_iri(obo_id)[源代码]
_resolve_term_iri(*, iri=None, obo_id=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.OLSTool[源代码]

基类:BaseTool

Interact with the EMBL-EBI Ontology Lookup Service (OLS) REST API.

_OPERATIONS = {'find_similar_terms': '_handle_find_similar_terms', 'get_ontology_info': '_handle_get_ontology_info', 'get_term_ancestors': '_handle_get_term_ancestors', 'get_term_children': '_handle_get_term_children', 'get_term_info': '_handle_get_term_info', 'search_ontologies': '_handle_search_ontologies', 'search_terms': '_handle_search_terms'}
__init__(tool_config)[源代码]
run(arguments=None, **_)[源代码]

Dispatch the requested OLS operation.

_handle_search_terms(arguments)[源代码]
_handle_get_ontology_info(arguments)[源代码]
_handle_search_ontologies(arguments)[源代码]
_handle_get_term_info(arguments)[源代码]
_handle_get_term_children(arguments)[源代码]
_handle_get_term_ancestors(arguments)[源代码]
_handle_find_similar_terms(arguments)[源代码]
_get_json(path, params=None)[源代码]

Make a GET request to the OLS API and return JSON response.

参数:
  • path (str) – API endpoint path

  • params (Dict[str, Any] | None) – Optional query parameters

返回:

JSON response as dictionary

抛出:
返回类型:

Dict[str, Any]

_format_term_collection(data, size)[源代码]
static _build_term_model(item)[源代码]
class tooluniverse.OMATool[源代码]

基类:BaseTool

Tool for querying the OMA Orthology Browser.

OMA provides orthology relationships among 2,600+ complete genomes using a highly reliable algorithm. Supports protein lookup, pairwise orthologs, Hierarchical Orthologous Groups (HOGs), and OMA Groups.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the OMA API call.

_query(arguments)[源代码]

Route to appropriate OMA endpoint.

_get_protein(arguments)[源代码]

Get protein information by UniProt accession or OMA ID.

_get_orthologs(arguments)[源代码]

Get pairwise orthologs for a protein.

_get_hog(arguments)[源代码]

Get Hierarchical Orthologous Group (HOG) information.

_get_group(arguments)[源代码]

Get OMA Group details (strict 1:1 orthologs across all genomes).

class tooluniverse.OMIMTool[源代码]

基类:BaseTool

Tool for querying OMIM (Online Mendelian Inheritance in Man).

OMIM provides: - Mendelian disease information - Gene-disease relationships - Clinical synopses - Inheritance patterns

Requires API key via OMIM_API_KEY environment variable. Register at https://omim.org/api for free academic access.

__init__(tool_config)[源代码]
_get_params(extra_params=None)[源代码]

Get base parameters with API key.

run(arguments)[源代码]

Execute OMIM API call based on operation type.

Search OMIM entries.

参数:

arguments (Dict[str, Any]) – Dict containing: - query: Search terms (gene name, disease name, phenotype) - limit: Maximum results (default 10, max 20) - start: Offset for pagination (default 0)

_get_entry(arguments)[源代码]

Get OMIM entry by MIM number.

参数:

arguments (Dict[str, Any]) – Dict containing: - mim_number: OMIM MIM number (e.g., 164730 for BRAF) - include: Data to include (default: all basic data)

_get_gene_map(arguments)[源代码]

Get gene-disease mapping information.

参数:

arguments (Dict[str, Any]) – Dict containing: - mim_number: OMIM MIM number for gene or phenotype OR - chromosome: Chromosome number (1-22, X, Y)

_get_clinical_synopsis(arguments)[源代码]

Get clinical synopsis (phenotype features) for an OMIM entry.

参数:

arguments (Dict[str, Any]) – Dict containing: - mim_number: OMIM MIM number for a phenotype entry

class tooluniverse.ORCIDTool[源代码]

基类:BaseTool

Tool for querying the ORCID Public API.

Provides access to: - Researcher profiles and biographical data - Publication works - Search across all ORCID records - Employment and affiliation history

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_make_request(path, params=None)[源代码]
_get_profile(arguments)[源代码]
_get_works(arguments)[源代码]
_search_researchers(arguments)[源代码]
_get_employments(arguments)[源代码]
class tooluniverse.OSFPreprintsTool[源代码]

基类:BaseTool

Search OSF Preprints via OSF API v2 filters.

参数(参数):

query (str): Query string max_results (int): Max results (default 10, max 100) provider (str): Optional preprint provider (e.g., ‘osf’, ‘psyarxiv’)

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.OmniPathTool[源代码]

基类:BaseTool

Tool for querying OmniPath intercellular and intracellular signaling data.

OmniPath integrates 100+ databases covering: - Ligand-receptor interactions (14,000+ pairs) - Intercellular communication roles - Signaling pathway interactions - Protein complexes (22,000+) - Cell communication annotations - Enzyme-substrate relationships

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the OmniPath API call.

_query(arguments)[源代码]

Route to appropriate OmniPath endpoint.

_make_request(path, params)[源代码]

Make an HTTP request to OmniPath API.

_get_ligand_receptor(arguments)[源代码]

Get ligand-receptor interactions from the ligrecextra dataset.

_get_intercell(arguments)[源代码]

Get intercellular communication role annotations.

_get_signaling(arguments)[源代码]

Get intracellular signaling pathway interactions.

_get_complexes(arguments)[源代码]

Get protein complex compositions.

_get_annotations(arguments)[源代码]

Get cell communication annotations from CellPhoneDB, CellChatDB, etc.

_get_enzyme_substrate(arguments)[源代码]

Get enzyme-substrate (PTM) interactions.

_get_tf_target_interactions(arguments)[源代码]
_get_dorothea_regulon(arguments)[源代码]
class tooluniverse.OncoKBTool[源代码]

基类:BaseTool

Tool for querying OncoKB precision oncology knowledge base.

OncoKB provides: - Actionable cancer variant annotations - Evidence levels for clinical actionability - FDA-approved and investigational treatments - Gene-level oncogenic classifications

Requires API token via ONCOKB_API_TOKEN environment variable. Demo API available for testing (limited to BRAF, TP53, ROS1 genes).

__init__(tool_config)[源代码]
property _api_mode: str

Return the current API mode label.

_get_headers()[源代码]

Get request headers with authentication.

_demo_gene_note(gene)[源代码]
_apply_demo_gene_warning(data, metadata, gene)[源代码]

Mutate data and metadata in-place with demo-mode warning when gene is absent.

_make_request(endpoint, params)[源代码]

Make a GET request to the OncoKB API with standard error handling.

run(arguments)[源代码]

Execute OncoKB API call based on operation type.

_annotate_variant(arguments)[源代码]

Annotate a specific variant for oncogenic potential and treatment implications.

_get_gene_info(arguments)[源代码]

Get gene-level oncogenic information.

_get_cancer_genes(arguments)[源代码]

Get list of all cancer genes curated in OncoKB.

_get_levels(arguments)[源代码]

Get information about OncoKB evidence levels.

_annotate_copy_number(arguments)[源代码]

Annotate copy number alterations (amplification/deletion).

class tooluniverse.OncoTreeBaseTool[源代码]

基类:BaseTool

Base class for OncoTree API tools.

__init__(tool_config)[源代码]
_get(endpoint, params=None)[源代码]
_handle_request(fn, *args, **kwargs)[源代码]
class tooluniverse.OncoTreeGetTypeTool[源代码]

基类:OncoTreeBaseTool

Get a specific OncoTree cancer type by its unique code.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_run(arguments)[源代码]
class tooluniverse.OncoTreeListTissuesTool[源代码]

基类:OncoTreeBaseTool

List all top-level tissue categories in the OncoTree hierarchy.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_run(arguments)[源代码]
class tooluniverse.OncoTreeSearchTool[源代码]

基类:OncoTreeBaseTool

Search OncoTree cancer types by name, code, main type, or tissue.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_run(arguments)[源代码]
class tooluniverse.AgingCohortSearchTool[源代码]

基类:BaseTool

Search a curated registry of major aging and longitudinal cohort studies.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_run(arguments)[源代码]
class tooluniverse.OntologyInfo[源代码]

基类:BaseModel

Description of a single ontology entry in OLS.

id: str
title: str
version: str | None
description: str | None
domain: str | None
homepage: HttpUrl | None
preferred_prefix: str | None
number_of_terms: int | None
number_of_classes: int | None
repository: HttpUrl | None
_abc_impl = <_abc._abc_data object>
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class tooluniverse.OntologySearchResponse[源代码]

基类:PagedResponse

Paginated collection of ontologies returned by the search endpoint.

ontologies: List[OntologyInfo]
_abc_impl = <_abc._abc_data object>
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class tooluniverse.OpenAIREDatasetTool[源代码]

基类:BaseTool

Search OpenAIRE for European research datasets.

run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

static _extract_text(field)[源代码]

Extract first text value from OpenAIRE’s {‘$’: value} or list-of-dicts.

static _extract_text_list(field)[源代码]

Extract all text values from OpenAIRE’s {‘$’: value} or list-of-dicts.

static _extract_doi(pid_field)[源代码]

Extract DOI from OpenAIRE pid field.

class tooluniverse.OpenAIRETool[源代码]

基类:BaseTool

Search OpenAIRE Explore for research products (publications by default).

参数(参数):

query (str): Query string max_results (int): Max number of results (default 10, max 100) type (str): product type filter: publications | datasets | software

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_endpoint_for_type(prod_type)[源代码]
_normalize(data, prod_type)[源代码]
class tooluniverse.OpenAlexGuidelinesTool[源代码]

基类:BaseTool

OpenAlex Guidelines Search Tool. Specialized tool for searching clinical practice guidelines using OpenAlex API.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_openalex_guidelines(query, limit, year_from=None, year_to=None)[源代码]

Search for clinical guidelines using OpenAlex API.

_reconstruct_abstract(abstract_inverted_index)[源代码]

Reconstruct abstract from inverted index.

class tooluniverse.OpenAlexRESTTool[源代码]

基类:BaseTool

Generic JSON-config driven OpenAlex REST tool.

Notes: - OpenAlex strongly encourages providing a contact email via the mailto query param. - This tool returns a consistent wrapper: {status, data, url} (plus error fields on failure).

__init__(tool_config)[源代码]
static _normalize_openalex_id(value)[源代码]
static _normalize_doi(value)[源代码]
_build_url_and_params(arguments)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.OpenAlexTool[源代码]

基类:BaseTool

Tool to retrieve literature from OpenAlex based on search keywords.

__init__(tool_config)[源代码]
run(arguments)[源代码]

工具的主要入口点。

search_literature(search_keywords, max_results=10, year_from=None, year_to=None, open_access=None, *, require_has_fulltext=False, fulltext_terms=None)[源代码]

Search for literature using OpenAlex API.

参数

search_keywords (str): Keywords to search for in title, abstract, and content. max_results (int): Maximum number of results to return (default: 10). year_from (int): Start year for publication date filter (optional). year_to (int): End year for publication date filter (optional). open_access (bool): Filter for open access papers only (optional).

退货

list: List of dictionaries containing paper information.

_extract_paper_info(work)[源代码]

Extract relevant information from a work object returned by OpenAlex API.

参数

work (dict): Work object from OpenAlex API response.

退货

dict: Formatted paper information.

get_paper_by_doi(doi)[源代码]

Retrieve a specific paper by its DOI.

参数

doi (str): DOI of the paper to retrieve.

退货

dict: Paper information or None if not found.

get_papers_by_author(author_name, max_results=10)[源代码]

Retrieve papers by a specific author.

参数

author_name (str): Name of the author to search for. max_results (int): Maximum number of results to return.

退货

list: List of papers by the author.

class tooluniverse.OpenCRAVATTool[源代码]

基类:BaseTool

Tool for querying OpenCRAVAT variant annotation API.

Supports single-variant annotation with configurable annotator selection. No authentication required for the public annotation endpoint.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the OpenCRAVAT API call.

_annotate_variant(arguments)[源代码]

Annotate a single variant with multiple annotation sources.

_list_annotators(arguments)[源代码]

List all available annotators on the OpenCRAVAT server.

class tooluniverse.OpenFDAApprovalTool[源代码]

基类:BaseTool

Tool for querying FDA drug approval and registration data via openFDA.

Uses the Drugs@FDA API to retrieve drug approval history, application types, sponsor information, and approved product details.

Supported operations: - search_approvals: Search drug approvals by name, sponsor, or application number - get_approval_history: Get complete approval/submission history for a drug - get_approved_products: Get approved product details (strengths, forms, routes)

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the OpenFDA Drug Approvals tool with given arguments.

_make_request(search, limit=5)[源代码]

Make GET request to openFDA drugsfda endpoint.

_format_date(date_str)[源代码]

Format YYYYMMDD date to YYYY-MM-DD.

_extract_approval_summary(result)[源代码]

Extract a summary from a drugsfda result.

_search_approvals(arguments)[源代码]

Search drug approvals by name, sponsor, or application number.

_get_approval_history(arguments)[源代码]

Get complete approval/submission history for a drug.

_get_approved_products(arguments)[源代码]

Get approved product details for a drug.

class tooluniverse.OpenFDADrugEventsTool[源代码]

基类:BaseRESTTool

OpenFDA drug adverse event search with convenience parameters.

Accepts either a raw Lucene ‘search’ string or the convenience parameters ‘drug_name’ and ‘reaction’ (which are assembled into a Lucene query).

Note: MedDRA terms in FAERS use British English spelling (e.g. ‘haemorrhage’ not ‘hemorrhage’, ‘haematoma’ not ‘hematoma’).

_VALID_API_PARAMS = frozenset({'api_key', 'count', 'limit', 'search', 'skip'})
run(arguments)[源代码]

Execute the API request.

参数:

arguments (Dict[str, Any]) – Tool arguments dictionary

返回:

Result dictionary with status, data, url, and optional error info

返回类型:

Dict[str, Any]

class tooluniverse.OpenNeuroTool[源代码]

基类:GraphQLTool

Tool for querying the OpenNeuro neuroimaging data repository.

OpenNeuro stores brain imaging datasets in BIDS format including: - MRI, fMRI, EEG, MEG, PET datasets - Dataset metadata, subjects, tasks, modalities - Download information and analytics

No authentication required for public datasets.

__init__(tool_config)[源代码]
tooluniverse.OpenTarget

OpentargetTool 的别名

tooluniverse.OpenTargetGenetics

OpentargetGeneticsTool 的别名

class tooluniverse.OpenTreeTool[源代码]

基类:BaseTool

Tool for querying the Open Tree of Life.

The Open Tree synthesizes published phylogenetic trees and taxonomy from NCBI, GBIF, IRMNG, and other sources into a single comprehensive tree of all life on Earth (~2.3 million tips).

Supports: name resolution (TNRS), taxonomy lookup, MRCA computation, and induced subtree extraction.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Open Tree of Life API call.

_query(arguments)[源代码]

Route to appropriate Open Tree endpoint.

_match_names(arguments)[源代码]

Resolve species names to OTT IDs via TNRS.

_get_taxon_info(arguments)[源代码]

Get taxonomy info for an OTT ID.

_get_mrca(arguments)[源代码]

Find Most Recent Common Ancestor of given OTT IDs.

_get_induced_subtree(arguments)[源代码]

Get Newick subtree for a set of OTT IDs.

class tooluniverse.OpentargetGeneticsTool[源代码]

基类:GraphQLTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.OpentargetTool[源代码]

基类:GraphQLTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.OpentargetToolDrugNameMatch[源代码]

基类:GraphQLTool

__init__(tool_config, drug_generic_tool=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.OrphanetTool[源代码]

基类:BaseTool

Tool for querying Orphanet rare disease database.

Orphanet provides: - Rare disease nomenclature and classification - Disease-gene associations - Epidemiology data (prevalence, inheritance) - Expert centers and patient organizations

RDcode API requires apiKey header (any value accepted). Orphadata API is free public access.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute Orphanet API call based on operation type.

_search_diseases(arguments)[源代码]

Search Orphanet for rare diseases by query term.

参数:

arguments (Dict[str, Any]) – Dict containing: - query: Search query (disease name, keyword) - limit: Maximum results to return (default: 20) - lang: Language code (en, fr, de, etc.). Default: en

_get_disease(arguments)[源代码]

Get disease details by ORPHA code.

参数:

arguments (Dict[str, Any]) – Dict containing: - orpha_code: Orphanet disease code (e.g., 558, 166024) - lang: Language code (default: en)

_extract_genes_from_associations(associations)[源代码]

Extract gene info dicts from DisorderGeneAssociation list.

_fetch_genes_for_code(orpha_code, headers)[源代码]

Fetch gene associations for a single ORPHA code. Returns [] on failure.

_find_subtype_codes(disease_name, exclude_code, headers)[源代码]

Find orphacodes whose name contains disease_name, excluding exclude_code.

_get_genes(arguments)[源代码]

Get genes associated with a rare disease.

Strategy: 1. Try direct Orphadata orphacode lookup for gene associations 2. If not found (parent codes often lack direct entries), search for

subtype entries whose name matches the disease name

  1. Fall back to gene name search as last resort

参数:

arguments (Dict[str, Any]) – Dict containing: - orpha_code: Orphanet disease code

_get_classification(arguments)[源代码]

Get disease classification hierarchy.

参数:

arguments (Dict[str, Any]) – Dict containing: - orpha_code: Orphanet disease code - lang: Language code (default: en)

_search_by_name(arguments)[源代码]

Search for diseases by exact or partial name match.

参数:

arguments (Dict[str, Any]) – Dict containing: - name: Disease name to search - exact: Whether to match exactly (default: False) - lang: Language code (default: en)

_get_phenotypes(arguments)[源代码]

Get HPO phenotypes associated with a rare disease.

参数:

arguments (Dict[str, Any]) – Dict containing: - orpha_code: Orphanet disease code (e.g., 558 for Marfan) - orpha_id: Alias for orpha_code

_get_epidemiology(arguments)[源代码]

Get epidemiology data (prevalence) for a rare disease.

参数:

arguments (Dict[str, Any]) – Dict containing: - orpha_code: Orphanet disease code

_get_natural_history(arguments)[源代码]

Get natural history data for a rare disease (age of onset, inheritance).

参数:

arguments (Dict[str, Any]) – Dict containing: - orpha_code: Orphanet disease code

_resolve_gene_symbol(symbol)[源代码]

Resolve a gene symbol (e.g. ‘FBN1’) to its full name (e.g. ‘fibrillin 1’).

The Orphadata /genes/names/ endpoint only matches full gene names, not symbols. When the caller passes a symbol, look it up in the gene list and return the full name so the name-search endpoint can find it. Returns None if no match is found.

_get_gene_diseases(arguments)[源代码]

Get rare diseases associated with a gene name or symbol.

Uses Orphadata gene name search to find diseases associated with genes matching the given search term. Accepts gene symbols (e.g., ‘FBN1’, ‘BRCA1’) or gene name keywords (e.g., ‘fibrillin’, ‘huntingtin’). Gene symbols are auto-resolved to full names for the API query.

参数:

arguments (Dict[str, Any]) – Dict containing: - gene_name: Gene symbol or name keyword (e.g., ‘FBN1’, ‘fibrillin’)

_get_icd_mapping(arguments)[源代码]

Get ICD-10, ICD-11, OMIM, and SNOMED-CT cross-references for a rare disease.

参数:

arguments (Dict[str, Any]) – Dict containing: - orpha_code: Orphanet disease code - coding_system: Which coding system to retrieve (icd10, icd11, omim, snomed). Default: all - lang: Language code (default: en)

class tooluniverse.OrthoDBTool[源代码]

基类:BaseTool

OrthoDB v12 tool for orthologous group analysis.

Provides search for orthologous groups, group details with functional annotations (KEGG, GO), and member gene lists across species.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the OrthoDB API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

Search for orthologous groups by gene/protein name.

_get_group(arguments)[源代码]

Get detailed information about an orthologous group.

_get_orthologs(arguments)[源代码]

Get orthologous genes in specific species from a group.

class tooluniverse.OxOTool[源代码]

基类:BaseTool

Tool for EBI OxO (Ontology Xref Service) API providing cross-reference mappings between ontology terms across biomedical databases.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the OxO API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_mappings(arguments)[源代码]

Get cross-reference mappings for a single ontology term.

_search_mappings(arguments)[源代码]

Search mappings for multiple terms at once.

class tooluniverse.PANTHERTool[源代码]

基类:BaseTool

Tool for querying PANTHER gene classification and enrichment analysis.

Provides gene functional annotation, overrepresentation analysis with GO/pathway enrichment, and ortholog mapping across 144 organisms.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PANTHER API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_gene_info(arguments)[源代码]

Get gene classification and functional annotation from PANTHER.

_enrichment(arguments)[源代码]

Perform gene set enrichment (overrepresentation) analysis.

_ortholog(arguments)[源代码]

Find orthologs of a gene across species.

class tooluniverse.PDBECompoundTool[源代码]

基类:BaseTool

Tool for querying PDBe compound (ligand/small molecule) information.

Supports: - Get compound summary (formula, weight, SMILES, InChI, cross-references) - Get all PDB structures containing a specific compound

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PDBe Compound API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_summary(arguments)[源代码]

Get detailed compound summary from PDBe.

_get_structures(arguments)[源代码]

Get PDB structures containing a specific compound via PDBe API.

class tooluniverse.PDBeAPIRESTTool[源代码]

基类:BaseTool

PDBe API REST tool. Generic wrapper for PDBe API endpoints defined in pdbe_api_tools.json.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments

_build_params(args)[源代码]

Build query parameters for PDBe API

_extract_assemblies_from_summary(pdb_id)[源代码]

Extract assemblies data from summary endpoint as fallback

run(arguments)[源代码]

Execute the PDBe API call

class tooluniverse.PDBeLigandsTool[源代码]

基类:BaseTool

Tool for querying PDBe structure-bound ligands and residue details.

Supports: - Get all ligands bound in a PDB structure (drug-like, cofactors, ions) - Get per-residue listing with observed ratio for a PDB chain

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PDBe API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_ligand_monomers(arguments)[源代码]

Get all ligand monomers bound in a PDB structure.

_get_residue_listing(arguments)[源代码]

Get per-residue listing for a PDB structure chain.

class tooluniverse.PDBePISATool[源代码]

基类:BaseTool

Tool for querying PDBePISA (Protein Interfaces, Surfaces and Assemblies).

PISA analyzes crystal structures to identify biological assemblies, protein-protein interfaces, and surface properties.

Supported operations: - get_interfaces: Get interface analysis for a PDB entry - get_assemblies: Get biological assembly predictions - get_monomer_analysis: Get monomer surface area analysis

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PDBePISA API tool with given arguments.

_fetch_xml(endpoint, pdb_id)[源代码]

Fetch and parse XML from a PISA CGI endpoint.

_get_interfaces(arguments)[源代码]

Get interface analysis for a PDB entry.

_get_assemblies(arguments)[源代码]

Get biological assembly predictions for a PDB entry.

_get_monomer_analysis(arguments)[源代码]

Get monomer (individual chain) surface area analysis.

Uses the interfaces endpoint and extracts per-molecule data from interface analyses, providing surface area information for each chain in the structure.

class tooluniverse.PDBeSIFTSTool[源代码]

基类:BaseTool

PDBe SIFTS Mapping tool for UniProt-PDB cross-referencing.

Provides ranked best structures for a protein, PDB-to-UniProt chain mapping, and comprehensive structure coverage analysis.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PDBe SIFTS API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_best_structures(arguments)[源代码]

Get best PDB structures for a UniProt protein, ranked by coverage and resolution.

_get_pdb_to_uniprot(arguments)[源代码]

Map PDB entry chains to UniProt accessions.

_get_uniprot_to_pdb(arguments)[源代码]

Get all PDB entries covering a UniProt protein.

class tooluniverse.PDBeSearchTool[源代码]

基类:BaseTool

Tool for searching PDBe, the Protein Data Bank in Europe.

Provides full-text and field-specific Solr queries across all PDB entries, plus compound/ligand lookup by identifier.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PDBe Search API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_search_structures(arguments)[源代码]

Search PDB structures by keyword or protein name.

_get_compound(arguments)[源代码]

Get PDB ligand/compound information by compound ID.

_search_by_organism(arguments)[源代码]

Search PDB structures filtered by organism.

class tooluniverse.PDBeValidationTool[源代码]

基类:BaseTool

Tool for querying PDBe structure validation data.

Supports: - Global quality percentile scores (Ramachandran, rotamer, clashscore) - Residue-level validation outliers

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PDBe Validation API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_quality_scores(arguments)[源代码]

Get global quality validation percentile scores.

_get_outlier_residues(arguments)[源代码]

Get residue-level validation outliers.

class tooluniverse.PDBe_KB_Tool[源代码]

基类:BaseTool

Tool for querying PDBe-KB (Knowledge Base) Graph API.

PDBe-KB aggregates structural biology knowledge including: - Ligand binding sites mapped to UniProt positions - Protein-protein interaction interfaces - Structural coverage statistics - Superposition clusters and best chain coverage

Data is indexed by UniProt accession and provides residue-level annotations using UniProt numbering.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PDBe-KB Graph API call.

_query(arguments)[源代码]

Route to appropriate PDBe-KB endpoint.

_get_summary_stats(arguments)[源代码]

Get aggregated structural summary statistics for a protein.

_get_ligand_sites(arguments)[源代码]

Get ligand binding site residues for a protein.

_get_interface_residues(arguments)[源代码]

Get protein-protein interaction interface residues.

_get_superposition(arguments)[源代码]

Get structural superposition clusters for a protein.

Returns clusters of structurally superposed PDB chains grouped by protein segments. Each cluster contains a representative structure and aligned member structures.

class tooluniverse.PDCTool[源代码]

基类:BaseTool

Tool for querying the NCI Proteomics Data Commons (PDC).

PDC houses annotated proteomics data from CPTAC, ICPC, APOLLO, CBTN, and other cancer research programs covering 19+ cancer types with 160+ datasets.

Provides access to: - Study search and metadata (disease type, analytical fraction, experiment type) - Gene/protein information with spectral counts across studies - Program and project listings (CPTAC, ICPC, APOLLO, etc.) - Detailed study summaries with file counts - Clinical data per study (demographics, diagnoses)

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute a PDC query.

_search_studies(arguments)[源代码]

Search PDC studies by name/keyword.

_get_gene_protein(arguments)[源代码]

Get protein information and study coverage for a gene symbol.

_list_programs(arguments)[源代码]

List all PDC programs and their projects.

_get_study_summary(arguments)[源代码]

Get detailed metadata for a specific study by PDC study ID.

_get_clinical_data(arguments)[源代码]

Get clinical metadata for samples in a study.

class tooluniverse.PMCTool[源代码]

基类:BaseTool

用于搜索PMC全文生物医学文献的工具。

__init__(tool_config=None)[源代码]
_normalize_pmcid(pmc_id)[源代码]
_extract_year_from_date(date_str)[源代码]
_parse_esummary_item(item)[源代码]
_parse_esummary_xml(xml_text)[源代码]

Parse NCBI E-utilities esummary XML into a dict keyed by numeric PMC id.

_build_paper_from_summary(pmc_numeric_id, items)[源代码]
_fetch_pubmed_abstracts(pmids)[源代码]

Best-effort: fetch PubMed abstracts for PMIDs via efetch XML.

Search for papers using PMC API.

参数:
  • query (str) – Search query

  • limit (int) – Maximum number of results

  • date_from (str | None) – Start date filter (YYYY/MM/DD)

  • date_to (str | None) – End date filter (YYYY/MM/DD)

  • article_type (str | None) – Article type filter (e.g., ‘research-article’, ‘review’)

退货

纸质词典列表

_extract_authors(authors)[源代码]

Extract author names from PMC API response.

_extract_year(pubdate)[源代码]

Extract year from publication date.

run(tool_arguments)[源代码]

执行PMC搜索。

参数:

tool_arguments – 包含搜索参数的字典

退货

纸质词典列表

class tooluniverse.PRIDERESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.PROSITETool[源代码]

基类:BaseTool

Tool for querying the PROSITE protein motif/domain database.

Supports three operations: - get_entry: Retrieve a PROSITE entry by accession (parses text format) - search: Search PROSITE entries by keyword (via InterPro API) - scan_sequence: Scan a protein sequence for PROSITE pattern matches

PROSITE_BASE_URL = 'https://prosite.expasy.org'
INTERPRO_BASE_URL = 'https://www.ebi.ac.uk/interpro/api'
SCANPROSITE_URL = 'https://prosite.expasy.org/cgi-bin/prosite/PSScan.cgi'
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PROSITE API call.

_parse_prosite_text(text)[源代码]

Parse PROSITE text format into a structured dictionary.

PROSITE text format uses two-letter tags: ID - Entry name and type AC - Accession number DT - Date stamps DE - Description PA - Pattern (for PATTERN type entries) MA - Matrix (for MATRIX/PROFILE type entries) CC - Comments (functional annotations, sites) PR - ProRule reference DO - Documentation reference DR - Database cross-references

_get_entry(arguments)[源代码]

Retrieve a PROSITE entry by accession.

Search PROSITE entries by keyword via InterPro API.

_scan_sequence(arguments)[源代码]

Scan a protein sequence against all PROSITE patterns.

class tooluniverse.PackageTool[源代码]

基类:BaseTool

通用工具,用于提供有关 Python 包的信息。通过 PyPI API 获取实时数据,并支持本地备用方案。

__init__(tool_config)[源代码]
run(arguments)[源代码]

获取全面的包信息。

参数:

arguments (dict) – 可选参数用于自定义

退货

dict: Package information including name, description, installation, docs, usage

_get_pypi_info(include_examples=True)[源代码]

Fetch package information from PyPI API

_get_local_info(include_examples=True)[源代码]

Get package information from local configuration

_get_installation_instructions()[源代码]

生成安装说明

_get_usage_example()[源代码]

获取该软件包的使用示例

_get_quick_start_guide()[源代码]

快速入门指南步骤

class tooluniverse.PagedResponse[源代码]

基类:BaseModel

Base structure for paginated responses returned by OLS.

total_elements: int
page: int
size: int
total_pages: int
_abc_impl = <_abc._abc_data object>
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class tooluniverse.PaleobiologyRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.PathwayCommonsTool[源代码]

基类:BaseTool

Tool for querying Pathway Commons (PC2) unified pathway/interaction database.

Supported operations: - search: Search for pathways, interactions, or molecular entities by gene/keyword - get_pathway: Get pathway details by URI - get_neighborhood: Get interaction neighborhood for a gene (SIF format)

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

Search PathwayCommons for pathways/interactions by gene or keyword.

_traverse(uri, path)[源代码]

Helper: call the PC2 traverse endpoint.

_get_pathway(arguments)[源代码]

Get pathway details by URI from PathwayCommons using traverse API.

_get_neighborhood(arguments)[源代码]

Get interaction neighborhood for a gene from PathwayCommons (SIF format).

class tooluniverse.PfamTool[源代码]

基类:BaseTool

Tool for Pfam protein family queries via the InterPro API.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Pfam API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_strip_html(text)[源代码]

Remove HTML tags from text.

_search_families(arguments)[源代码]

Search Pfam families by keyword.

_get_family_detail(arguments)[源代码]

Get detailed information about a specific Pfam family.

_get_family_proteins(arguments)[源代码]

Get proteins containing a specific Pfam domain, optionally filtered by species.

_get_protein_pfam(arguments)[源代码]

Get all Pfam domain annotations for a specific protein.

_search_clans(arguments)[源代码]

Search Pfam clans (superfamilies).

_get_family_proteomes(arguments)[源代码]

Get proteome distribution for a Pfam family.

class tooluniverse.PharmGKBTool[源代码]

基类:BaseTool

Tool for querying PharmGKB REST API.

PharmGKB provides pharmacogenomics data: - Drug-gene-variant clinical annotations - CPIC dosing guidelines - Drug and gene details - Pharmacogenetic pathways

No authentication required for most endpoints.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PharmGKB API call.

_error(message)[源代码]
_request_json(url, params)[源代码]
_search_entity(entity_type, arguments)[源代码]

Search for drugs, genes, or variants.

_get_entity_details(entity_type, arguments)[源代码]

Get details for a specific entity by PharmGKB ID.

_get_clinical_annotations(arguments)[源代码]

Get clinical annotations. Best retrieved by specific ID or filtered.

_get_dosing_guidelines(arguments)[源代码]

Get CPIC/DPWG dosing guidelines.

class tooluniverse.PharmacoDBTool[源代码]

基类:BaseTool

Tool for querying the PharmacoDB cancer pharmacogenomics database.

PharmacoDB integrates drug sensitivity data across 10 major datasets: CCLE, CTRPv2, FIMM, GDSC1, GDSC2, GRAY, NCI60, PRISM, UHNBreast, gCSI.

Provides access to: - Compound/drug information with annotations and targets - Cell line information with tissue classification - Drug sensitivity experiments with dose-response curves - Pharmacological profiles (IC50, AAC, EC50, DSS scores) - Gene-compound biomarker associations

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute a PharmacoDB query.

Search across compounds, cell lines, tissues, and genes.

_get_compound(arguments)[源代码]

Get compound details with annotations and targets.

_get_cell_line(arguments)[源代码]

Get cell line details including tissue, synonyms, and diseases.

_get_experiments(arguments)[源代码]

Get drug sensitivity experiments with dose-response data and profiles.

_list_datasets(arguments)[源代码]

List all available pharmacogenomics datasets.

_resolve_compound_id(compound_name)[源代码]

Resolve a compound name to its PharmacoDB database ID.

_get_biomarker_associations(arguments)[源代码]

Get gene-compound biomarker associations across tissues and datasets.

class tooluniverse.PharosTool[源代码]

基类:BaseTool

Tool for querying Pharos/TCRD GraphQL API.

Pharos provides drug target information including: - Target Development Level (Tdark, Tbio, Tchem, Tclin) - Druggability assessments - Protein family classifications - Disease associations - Ligand/drug information

No authentication required. Free for academic/research use.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Pharos API call.

_execute_graphql(query, variables=None)[源代码]

Execute a GraphQL query against Pharos API.

_get_target(arguments)[源代码]

Get detailed target information by gene symbol or UniProt ID.

Returns TDL classification, protein family, disease associations, ligands, and druggability information.

_search_targets(arguments)[源代码]

Search targets by query string.

Returns targets matching the search term with TDL classification.

_get_tdl_summary(arguments)[源代码]

Get Target Development Level summary statistics.

Returns counts of targets at each TDL level: - Tclin: Targets with approved drugs - Tchem: Targets with small molecule activities - Tbio: Targets with biological annotations - Tdark: Understudied targets with minimal information

_get_disease_targets(arguments)[源代码]

Get targets associated with a disease.

Returns targets with TDL classification for drug discovery prioritization.

class tooluniverse.PlantReactomeTool[源代码]

基类:BaseTool

Tool for querying the Plant Reactome pathway database.

Plant Reactome provides curated plant metabolic and regulatory pathways. Supports searching pathways, getting pathway details, and listing available species. Covers photosynthesis, carbon fixation, nitrogen metabolism, hormone signaling, secondary metabolites, and more.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Plant Reactome API call.

_query(arguments)[源代码]

Route to appropriate query method.

Search for plant pathways.

_get_pathway(arguments)[源代码]

Get detailed pathway information.

_list_species(arguments)[源代码]

List all available plant species.

class tooluniverse.PomBaseTool[源代码]

基类:BaseTool

Tool for querying PomBase, the S. pombe genome database.

Provides detailed gene information for fission yeast including protein domains, GO annotations, phenotypes, and more.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PomBase API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_gene_detail(arguments)[源代码]

Get detailed gene information from PomBase by systematic ID.

Search PomBase gene summaries by gene name or keyword.

_gene_phenotypes(arguments)[源代码]

Get phenotype information for a PomBase gene.

class tooluniverse.PopGenTool[源代码]

基类:BaseTool

Population genetics calculator: HWE, Fst, inbreeding, haplotypes.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_hwe_test(arguments)[源代码]
_fst(arguments)[源代码]
_inbreeding(arguments)[源代码]
_haplotype_count(arguments)[源代码]
class tooluniverse.ProgenetixTool[源代码]

基类:BaseTool

Tool for querying the Progenetix cancer CNV database via GA4GH Beacon v2.

Progenetix contains genome-wide CNV profiles from 100,000+ tumor samples across hundreds of cancer types, classified using NCIt ontology codes.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Progenetix Beacon API call.

_query(arguments)[源代码]

Route to appropriate Progenetix endpoint.

_get_biosamples(arguments)[源代码]

Search biosamples (tumor samples) by NCIt disease code or other filters.

_get_individuals(arguments)[源代码]

Search individuals (patients) by NCIt disease code or other filters.

_get_filtering_terms(arguments)[源代码]

List available filtering terms (ontology codes) in Progenetix.

_get_cohorts(arguments)[源代码]

List available cohorts in Progenetix.

Search for biosamples with CNVs in a specific genomic region.

class tooluniverse.ProtParamTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.ProtVarFunctionTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.ProtVarMapTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
static _normalize_variant(variant)[源代码]

Convert colon-separated genomic ‘chr:pos:ref:alt’ to VCF ‘chr pos . ref alt’.

run(arguments)[源代码]
class tooluniverse.ProtVarPopulationTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
tooluniverse.ProtVarTool

ProtVarMapTool 的别名

class tooluniverse.ProtacDBTool[源代码]

基类:BaseTool

Tool for querying PROTAC-DB 3.0 (Zhejiang University).

Provides access to: - PROTAC compound search and retrieval by target or E3 ligase - Compound details (SMILES, DC50, Dmax, cell lines, references) - Target protein information

__init__(tool_config)[源代码]
_get_session_with_xsrf()[源代码]
_build_files(session, extra=None)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_protacs(arguments)[源代码]
_get_protac(arguments)[源代码]
_search_targets(arguments)[源代码]
class tooluniverse.ProteinStructure3DTool[源代码]

基类:VisualizationTool

Tool for visualizing 3D protein structures using py3Dmol.

run(arguments)[源代码]

Generate 3D protein structure visualization.

_fetch_pdb_content(pdb_id)[源代码]

Fetch PDB content from RCSB PDB database.

_create_control_panel(current_style, current_color)[源代码]

Create floating control panel HTML.

_create_toolbar()[源代码]

Create bottom toolbar HTML.

_create_protein_info_cards(pdb_id, pdb_data)[源代码]

Create protein information cards.

class tooluniverse.ProteinsAPIRESTTool[源代码]

基类:BaseTool

Proteins API REST tool. Generic wrapper for Proteins API endpoints defined in proteins_api_tools.json.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build URL from endpoint template and arguments

_build_params(args)[源代码]

Build query parameters for Proteins API

_extract_from_protein_endpoint(accession, tool_name)[源代码]

Extract data from main protein endpoint when specific endpoints don’t exist

_parse_accessions(accession)[源代码]

Parse accession parameter - handle string, list, or comma-separated string

_handle_batch_request(accessions, tool_name, format='json')[源代码]

Handle batch requests by making multiple API calls and aggregating results

run(arguments)[源代码]

Execute the Proteins API call

class tooluniverse.ProteinsPlusRESTTool[源代码]

基类:AsyncPollingTool

ProteinsPlus API tool for protein-ligand docking and binding site analysis.

Now uses AsyncPollingTool base class for automatic polling, progress reporting, and timeout management. Original functionality preserved.

_SIENA_OPTIONAL_KEYS = {'flexibility_sensitivity': 'flexibility_sensitivity', 'fragment_length': 'fragment_length', 'maximum_mutations': 'maximum_mutations', 'minimal_site_coverage': 'minimalSiteCoverage', 'minimal_site_identity': 'minimalSiteIdentity', 'site_radius': 'siteRadius'}
__init__(tool_config)[源代码]

Initialize ProteinsPlus tool with configuration.

_transform_params(arguments)[源代码]

Transform user-facing arguments into the nested format ProteinsPlus expects.

_build_api_url(arguments)[源代码]

Build API URL by substituting argument placeholders in the endpoint.

_validate_required(arguments)[源代码]

Raise ValueError if any required parameters are missing.

submit_job(arguments)[源代码]

Submit job to ProteinsPlus API and return job location URL.

This method handles job submission for async tools. For sync tools, it’s not called (handled by run() override).

check_status(job_id)[源代码]

Check ProteinsPlus job status and return result if complete.

参数:

job_id (str) – Job location URL from submit_job()

返回:

  • done (bool): True if complete

  • result (any): Results if done

  • progress (int): Progress percentage (0-100)

  • error (str): Error message if failed

返回类型:

Dict with keys

format_result(result)[源代码]

Format ProteinsPlus results into standard response format.

async run(arguments, progress=None)[源代码]

使用提供的参数执行工具。

Overrides AsyncPollingTool.run() to support both sync and async tools.

async _run_sync_request(arguments, progress)[源代码]

Execute a synchronous (non-polling) request.

_abc_impl = <_abc._abc_data object>
class tooluniverse.ProteomeXchangeTool[源代码]

基类:BaseTool

Tool for querying ProteomeXchange, the proteomics data consortium.

Provides access to metadata for proteomics datasets including species, instruments, publications, and data files from PRIDE, MassIVE, PeptideAtlas, jPOST, and iProX.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the ProteomeXchange API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_extract_cv_value(terms, accession_prefix=None, name_match=None)[源代码]

Extract a value from CV terms list.

_get_dataset(arguments)[源代码]

Get a ProteomeXchange dataset by PX identifier.

_search_datasets(arguments)[源代码]

Search ProteomeXchange datasets via ProteomeCentral API.

class tooluniverse.ProteomicsDBTool[源代码]

基类:BaseTool

Tool for querying ProteomicsDB, a mass spectrometry-based protein expression database covering human tissues, cell lines, and body fluids.

Complements HPA (antibody-based) with MS-based quantitative proteomics from the Human Proteome Project. Provides iBAQ and TOP3 quantification across 340+ biological sources.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute a ProteomicsDB query.

_get_protein_expression(arguments)[源代码]

Get protein expression across tissues/cell lines.

_search_proteins(arguments)[源代码]

Search for proteins by gene name, UniProt ID, or protein name.

_get_expression_summary(arguments)[源代码]

Get top tissues by expression level for a protein.

_list_tissues(arguments)[源代码]

List all available tissues/cell lines in ProteomicsDB.

class tooluniverse.PubChemBioAssayTool[源代码]

基类:BaseTool

Tool for querying PubChem BioAssay data.

Access biological assay descriptions, targets, and screening results from PubChem. Supports searching by assay ID, target gene, or keyword.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PubChem BioAssay API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_assay(arguments)[源代码]

Get detailed description of a bioassay by its AID.

_search_by_gene(arguments)[源代码]

Search for bioassays targeting a specific gene.

_get_assay_summary(arguments)[源代码]

Get summary and target information for a bioassay.

class tooluniverse.PubChemRESTTool[源代码]

基类:BaseTool

通用的PubChem PUG-REST工具类。直接根据fields.endpoint模板拼接URL,并向PubChem PUG-REST发送请求。

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]

使用正则表达式替换 endpoint_template 中的所有 {placeholder} 以生成完整的 URL 路径。例如,endpoint_template=”/compound/cid/{cid}/property/{property_list}/JSON”,参数 arguments={“cid”:2244},property_list=[“MolecularWeight”,”IUPACName”] → “/compound/cid/2244/property/MolecularWeight,IUPACName/JSON”。最终返回 “https://pubchem.ncbi.nlm.nih.gov/rest/pug” + 拼接后的路径。

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.PubChemToxTool[源代码]

基类:BaseTool

Tool for PubChem toxicity and safety data via PUG View API.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the PubChem toxicity API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_resolve_cid(arguments)[源代码]

Resolve compound name to CID if needed.

_strip_html(text)[源代码]

Remove HTML tags from text.

_find_sections_recursive(sections, heading)[源代码]

Recursively find all sections matching a heading at any depth.

_extract_info_from_sections(sections, heading)[源代码]

Find sections matching heading recursively and extract their Information entries.

_get_pugview_data(cid, heading)[源代码]

Get PUG View data for a specific heading.

_get_ghs_classification(arguments)[源代码]

Get GHS (Globally Harmonized System) hazard classification for a compound.

_get_toxicity_values(arguments)[源代码]

Get non-human toxicity values (LD50, LC50, etc.) for a compound.

_get_carcinogen_classification(arguments)[源代码]

Get carcinogen classification data for a compound.

_get_target_organs(arguments)[源代码]

Get target organs affected by a chemical compound.

_get_acute_effects(arguments)[源代码]

Get acute toxicity effects for a compound.

Pulls from multiple PUG View headings: Signs and Symptoms, Acute Effects, and Exposure Routes to provide comprehensive acute toxicity information.

_get_toxicity_summary(arguments)[源代码]

Get comprehensive toxicity summary including multiple toxicity data sections.

class tooluniverse.PubMedGuidelinesTool[源代码]

基类:BaseTool

Search PubMed for clinical practice guidelines. Uses NCBI E-utilities with guideline publication type filter.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_pubmed_guidelines(query, limit, api_key)[源代码]

Search PubMed for guideline publications.

class tooluniverse.PubMedRESTTool[源代码]

基类:BaseRESTTool

Generic REST tool for PubMed E-utilities (efetch, elink).

Implements rate limiting per NCBI guidelines: - Without API key: 3 requests/second - With API key: 10 requests/second

API key is read from environment variable NCBI_API_KEY. Get your free key at: https://www.ncbi.nlm.nih.gov/account/

_last_request_time = 0.0
_rate_limit_lock = <unlocked _thread.lock object>
__init__(tool_config)[源代码]
_get_param_mapping()[源代码]

Map PubMed E-utilities parameter names.

_enforce_rate_limit(has_api_key)[源代码]

Enforce NCBI E-utilities rate limits.

参数:

has_api_key (bool) – Whether an API key is provided

_build_params(args)[源代码]

Build E-utilities parameters with special handling.

_fetch_summaries(pmid_list)[源代码]

Fetch article summaries for a list of PMIDs using esummary.

参数:

pmid_list (list) – List of PubMed IDs

返回:

Dict with article summaries or error

返回类型:

Dict[str, Any]

_parse_efetch_xml(response)[源代码]

Parse PubMed efetch XML into structured article data.

_fetch_abstracts(pmid_list)[源代码]

Best-effort abstract fetch via efetch XML for a list of PMIDs.

run(arguments)[源代码]

PubMed E-utilities need special handling for direct endpoint URLs. Enforces NCBI rate limits to prevent API errors.

class tooluniverse.PubTatorTool[源代码]

基类:BaseTool

围绕单个PubTator 3端点的通用包装器,支持JSON定义的配置。

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_compose_url(args)[源代码]

替换模板变量并构建完整的URL。

_query_params(args)[源代码]

将调用者参数名转换为API参数名,丢弃None值,序列化列表。

_filter_search_results(result)[源代码]

根据分数阈值筛选 PubTatorSearch 结果,并移除仅包含“name”、“type”和“value”的分类项。

class tooluniverse.PyPIPackageInspector[源代码]

基类:BaseTool

Extracts comprehensive package information from PyPI and GitHub. Provides detailed metrics on popularity, maintenance, security, and compatibility.

__init__(tool_config=None)[源代码]
_get_pypi_metadata(package_name)[源代码]

Fetch comprehensive metadata from PyPI

_get_download_stats(package_name)[源代码]

Fetch download statistics from pypistats.org

_get_github_stats(github_url)[源代码]

Fetch repository statistics from GitHub

_calculate_quality_scores(pypi_data, downloads, github_data)[源代码]

Calculate quality scores based on collected metrics

_generate_recommendation(scores, pypi_data, github_data)[源代码]

Generate a human-readable recommendation based on scores

run(arguments)[源代码]

Inspect a package and return comprehensive quality metrics

参数:
  • package_name – Name of the package to inspect

  • include_github – Whether to fetch GitHub stats (default: True)

  • include_downloads – Whether to fetch download stats (default: True)

返回:

Dict with package metadata, statistics, and quality scores

返回类型:

Dict[str, Any]

class tooluniverse.PythonCodeExecutor[源代码]

基类:BasePythonExecutor, BaseTool

Execute Python code snippets safely in sandboxed environment.

__init__(tool_config)[源代码]

Initialize the executor with tool configuration.

run(arguments)[源代码]

Execute Python code snippet with safety checks and timeout.

class tooluniverse.PythonScriptRunner[源代码]

基类:BasePythonExecutor, BaseTool

Run Python script files in isolated subprocess with resource limits.

__init__(tool_config)[源代码]

Initialize the executor with tool configuration.

run(arguments)[源代码]

Run Python script file in subprocess with safety limits.

class tooluniverse.QuickGOTool[源代码]

基类:BaseTool

Tool for querying the EBI QuickGO Gene Ontology browser.

QuickGO provides comprehensive GO annotation data with filtering by gene product, GO term, taxon, evidence code, and more. Also provides ontology term details and hierarchical relationships.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the QuickGO API call.

_query(arguments)[源代码]

Route to appropriate QuickGO endpoint.

_annotation_by_gene(arguments)[源代码]

Search GO annotations for a specific gene product.

_annotation_by_goterm(arguments)[源代码]

Search GO annotations for a specific GO term.

_term_detail(arguments)[源代码]

Get detailed information about a GO term.

_term_children(arguments)[源代码]

Get child terms of a GO term.

class tooluniverse.RCSBAdvancedSearchTool[源代码]

基类:BaseTool

Advanced attribute-based search of the RCSB Protein Data Bank.

Enables complex queries combining organism, resolution, experimental method, molecular weight, and more. Returns PDB IDs matching all criteria.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the RCSB advanced search.

_query(arguments)[源代码]

Route to appropriate endpoint.

Search PDB by multiple attribute filters.

Search PDB by sequence motif pattern.

class tooluniverse.RCSBDataTool[源代码]

基类:BaseTool

Tool for RCSB PDB Data API providing direct REST access to PDB structure metadata, biological assembly info, and non-polymer entities.

Complements existing RCSB GraphQL and Search tools by providing simpler, direct access to individual resource endpoints.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the RCSB Data API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_entry(arguments)[源代码]

Get comprehensive entry details for a PDB structure.

_get_assembly(arguments)[源代码]

Get biological assembly details for a PDB structure.

_get_nonpolymer_entity(arguments)[源代码]

Get non-polymer entity (ligand/small molecule) details.

class tooluniverse.RCSBGraphQLTool[源代码]

基类:BaseTool

Tool for querying the RCSB PDB Data API via GraphQL.

Supports: - Structure summary (title, resolution, method, citation, etc.) - Chemical component / ligand details (formula, SMILES, targets) - Polymer entity details (sequence, annotations, descriptions)

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the RCSB GraphQL query.

_query(arguments)[源代码]

Route to appropriate GraphQL query.

_execute_graphql(query_str)[源代码]

Execute a GraphQL query against the RCSB Data API.

_get_structure_summary(arguments)[源代码]

Get comprehensive structure summary for one or more PDB IDs.

_get_ligand_info(arguments)[源代码]

Get chemical component (ligand) information from PDB.

_get_polymer_entity(arguments)[源代码]

Get polymer entity details (sequence, annotations, etc.).

class tooluniverse.RCSBSearchTool[源代码]

基类:BaseTool

Tool for searching similar protein structures using RCSB PDB Search API v2.

Supports: - Sequence-based similarity search - Structure-based similarity search (using PDB ID) - Text-based search (by name, keyword, etc.)

__init__(tool_config)[源代码]
_validate_pdb_id(pdb_id)[源代码]

Validate PDB ID format (4 characters, alphanumeric)

_validate_sequence(sequence)[源代码]

Validate protein sequence (amino acids only)

_build_sequence_query(sequence, identity_cutoff, max_results)[源代码]

Build sequence similarity search query.

Uses the correct RCSB Search API v2 format: - Uses “value” parameter (not “target”) - Includes evalue_cutoff (required, default 0.1) - Includes identity_cutoff (optional, 0-1) - Includes sequence_type (“protein”)

_build_structure_query(pdb_id, similarity_threshold, max_results)[源代码]

Build structure similarity search query.

Uses the correct RCSB Search API v2 format: - Uses “value” as an object with “entry_id” and “assembly_id” - Includes “operator” (default: “strict_shape_match”) - Includes “target_search_space” (default: “assembly”)

_enrich_text_results(results)[源代码]

Fetch title, resolution, and method for text search PDB IDs.

_build_text_query(search_text, max_results)[源代码]

Build text search query.

Uses the correct RCSB Search API v2 format: - Searches in multiple attributes

(struct.title, struct_keywords.pdbx_keywords)

  • Uses OR logic to combine search conditions

  • Supports pagination and sorting

_parse_search_results(response_data)[源代码]

Parse RCSB Search API response.

Expected response format: {

“query_id”: “…”, “result_type”: “entry”, “total_count”: 123, “result_set”: [

{“identifier”: “6B3Q”, “score”: 1.0}, …

]

请提供需要翻译的具体英文文本内容,我将为您翻译成符合要求的中文。

run(arguments=None, stream_callback=None, use_cache=False, validate=True)[源代码]

Execute structure similarity search.

参数:
  • arguments (Dict[str, Any] | None) –

    Dictionary containing: - query: PDB ID, protein sequence, or search text - search_type: “sequence”, “structure”, or “text”

    (default: “sequence”)

    • similarity_threshold: Similarity threshold 0-1 (default: 0.7) (not used for text search)

    • max_results: Maximum number of results (default: 20)

  • stream_callback (Any | None) – Optional callback for streaming

  • use_cache (bool) – Whether to use caching

  • validate (bool) – Whether to validate parameters

返回:

Dictionary with search results or error information

返回类型:

Dict[str, Any]

class tooluniverse.RCSBTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
validate_params(params)[源代码]
prepare_input_ids(params)[源代码]
_split_composite_id(value, sep, expected_parts, label)[源代码]
_rest_url_for_input_id(input_id)[源代码]
_run_via_rest(input_ids)[源代码]
run(params)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.RDKitCheminfoTool[源代码]

基类:BaseTool

RDKit-based cheminformatics tools for pharmacophore and MMP analysis.

Endpoints: - pharmacophore_features: Extract pharmacophore feature centers from SMILES - matched_molecular_pair: Find molecular transformation between two SMILES

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_parse_smiles(smiles)[源代码]
_get_descriptors(mol)[源代码]
_pharmacophore_features(arguments)[源代码]

Extract pharmacophore features from SMILES using SMARTS matching.

_matched_molecular_pair(arguments)[源代码]

Find MMP transformation between two SMILES compounds.

class tooluniverse.RESTfulTool[源代码]

基类:GraphQLTool

__init__(tool_config, endpoint_url)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.RGDTool[源代码]

基类:BaseTool

Tool for querying the Rat Genome Database (RGD).

Supported operations: - get_gene: Get rat gene details by RGD ID - search_genes: Search rat genes by symbol/keyword - get_annotations: Get disease/phenotype annotations for a gene - get_orthologs: Get orthologs across species

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_get_gene(arguments)[源代码]
_search_genes(arguments)[源代码]
_get_annotations(arguments)[源代码]
_get_orthologs(arguments)[源代码]
class tooluniverse.RNAcentralGetTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.RNAcentralSearchTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.Re3DataTool[源代码]

基类:BaseTool

Search and retrieve metadata from the re3data.org registry of research data repositories.

BASE_URL = 'https://www.re3data.org/api/beta'
__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_repositories(args)[源代码]
_get_repository(args)[源代码]
class tooluniverse.ReMapRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.ReactomeAnalysisTool[源代码]

基类:BaseTool

Tool for Reactome pathway analysis (enrichment/overrepresentation).

Accepts gene/protein identifiers and performs overrepresentation analysis or species comparison against Reactome pathways. Returns enriched pathways with p-values, FDR, and entity counts.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Reactome Analysis API call.

_query(arguments)[源代码]

Route to appropriate analysis endpoint.

_pathway_enrichment(arguments)[源代码]

Perform pathway overrepresentation analysis.

_species_comparison(arguments)[源代码]

Perform species comparison analysis.

_token_result(arguments)[源代码]

Retrieve analysis results by token.

_format_analysis_result(data, identifiers)[源代码]

Format analysis result into standard output.

class tooluniverse.ReactomeContentTool[源代码]

基类:BaseTool

Tool for Reactome Content Service providing pathway search, contained event retrieval, and enhanced pathway details.

Complements existing Reactome tools by adding free-text search and hierarchical event decomposition.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Reactome Content Service API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

static _strip_html(text)[源代码]

Remove HTML tags from text.

Search Reactome for pathways, reactions, and other entities.

_get_contained_events(arguments)[源代码]

Get all events (sub-pathways and reactions) contained in a pathway.

_get_enhanced_pathway(arguments)[源代码]

Get enhanced pathway details including literature, GO terms, and sub-events.

class tooluniverse.ReactomeInteractorsTool[源代码]

基类:BaseTool

Tool for querying protein interactors and entity pathways from Reactome.

Reactome provides curated protein-protein interaction data derived from IntAct, with confidence scores and evidence counts. Also supports finding Reactome pathways associated with specific entities.

Supports: get protein interactors, find pathways for entity, search Reactome entities.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Reactome API call.

_query(arguments)[源代码]

Route to appropriate Reactome endpoint.

_get_interactors(arguments)[源代码]

Get protein-protein interactors for a UniProt accession.

_get_entity_pathways(arguments)[源代码]

Get Reactome pathways associated with a specific entity.

_search_entity(arguments)[源代码]

Search Reactome for entities (proteins, complexes, reactions).

class tooluniverse.ReactomeRESTTool[源代码]

基类:BaseTool

通用Reactome内容服务REST工具。如果配置中没有“fields.extract_path”或其值为空,则返回完整的JSON;否则,根据extract_path中的“点分隔路径”向下钻取,并返回对应的子节点。

__init__(tool_config)[源代码]
_build_url(arguments)[源代码]

将包含 {xxx} 的 endpoint_template 与参数中的路径参数结合,生成完整的 URL。例如 endpoint_template=”/data/pathway/{stId}”,arguments={“stId”:”R-HSA-73817”} → 返回 “https://reactome.org/ContentService/data/pathway/R-HSA-73817

run(arguments, stream_callback=None, use_cache=False, validate=True)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.RegulomeDBRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.RemoteTool[源代码]

基类:BaseTool

A placeholder tool class for external MCP/SMCP tools.

RemoteTool represents tools that are hosted on external MCP/SMCP servers and are only available for discovery and listing purposes. These tools cannot be executed locally through ToolUniverse but their configurations are preserved for reference.

tool_config

The tool configuration dictionary

类型:

dict

remote_info

Information about the remote server and tool

类型:

dict

__init__(tool_config=None)[源代码]

Initialize the RemoteTool.

参数:

tool_config (dict, optional) – Tool configuration dictionary

run(arguments=None)[源代码]

Placeholder run method for remote tools.

Remote tools cannot be executed locally. This method always returns an error message indicating that the tool is not available for local execution.

参数:

arguments (dict, optional) – Tool arguments (ignored)

退货

dict: Error message indicating the tool is not available locally

get_remote_info()[源代码]

Get information about the remote server hosting this tool.

退货

dict: Remote server information including server type, URL, and original tool type

is_available_locally()[源代码]

Check if this tool is available for local execution.

退货

bool: Always False for RemoteTool instances

get_server_info()[源代码]

Get server connection information for this remote tool.

退货

dict: Server connection details

class tooluniverse.RfamTool[源代码]

基类:BaseTool

Rfam Database API tool for RNA family data.

Provides access to: - RNA family information and metadata - Secondary structure diagrams - Covariance models - Sequence alignments (Stockholm, FASTA formats) - Phylogenetic trees - Sequence searches

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Rfam API tool with given arguments.

_get_family(arguments)[源代码]

Get RNA family information.

_get_family_accession(arguments)[源代码]

Convert family ID to accession.

_get_family_id(arguments)[源代码]

Convert family accession to ID.

_get_covariance_model(arguments)[源代码]

Get covariance model for RNA family.

_get_alignment(arguments)[源代码]

Get sequence alignment for RNA family.

_get_tree_data(arguments)[源代码]

Get phylogenetic tree data in NHX format.

_get_sequence_regions(arguments)[源代码]

Get sequence regions for RNA family.

_get_structure_mapping(arguments)[源代码]

Get mapping between RNA family and PDB structures.

_search_sequence(arguments)[源代码]

Search RNA sequence against Rfam families.

class tooluniverse.RheaTool[源代码]

基类:BaseTool

Tool for querying the Rhea biochemical reaction database.

Rhea contains over 15,000 manually curated biochemical reactions, each linked to ChEBI compounds and EC enzyme numbers. The search API returns TSV which is parsed to structured JSON.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Rhea API call.

_query(arguments)[源代码]

Route to appropriate Rhea endpoint.

_parse_tsv(text)[源代码]

Parse TSV response into list of dicts.

_search_reactions(arguments)[源代码]

Search for biochemical reactions by name, compound, or keyword.

_search_by_ec(arguments)[源代码]

Search for reactions by EC (Enzyme Commission) number.

_search_by_chebi(arguments)[源代码]

Search for reactions involving a specific ChEBI compound.

class tooluniverse.RxClassTool[源代码]

基类:BaseTool

Drug classification via NLM RxClass API.

Operations:
  • get_drug_classes: Get ATC, EPC, MoA, VA drug classes for a drug

  • get_class_members: List drugs in a specified drug class

  • find_classes: Search drug classes by keyword

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_get_drug_classes(arguments)[源代码]
_get_class_members(arguments)[源代码]
_find_classes(arguments)[源代码]
class tooluniverse.RxNormExtendedTool[源代码]

基类:BaseTool

Extended RxNorm tools for drug information retrieval.

Supports three operations:
  • find_rxcui: Resolve a drug name to its RXCUI identifier(s)

  • get_drug_info: Fetch full properties (name, TTY, synonym) by RXCUI or name

  • get_related_drugs: List all branded and generic clinical drug products

    that share an active ingredient

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_resolve_rxcui(arguments)[源代码]

Return (rxcui_str, error_dict_or_None).

_find_rxcui(arguments)[源代码]

Resolve a drug name to one or more RXCUIs.

_get_drug_info(arguments)[源代码]

Fetch comprehensive drug properties by RXCUI or drug name.

List branded and generic products for an ingredient RXCUI (or name).

class tooluniverse.RxNormTool[源代码]

基类:BaseTool

Tool for querying RxNorm API to get drug standardization information.

This tool performs a two-step process: 1. Look up RXCUI (RxNorm Concept Unique Identifier) by drug name 2. Retrieve all associated names (generic names, brand names, synonyms, etc.) using RXCUI

__init__(tool_config)[源代码]
_preprocess_drug_name(drug_name)[源代码]

Preprocess drug name to improve matching success rate. Removes common patterns that might prevent matching: - Dosage information (e.g., “200mg”, “81mg”) - Formulations (e.g., “tablet”, “capsule”, “oral”) - Modifiers (e.g., “Extra Strength”, “Extended Release”) - Special characters that might interfere

参数:

drug_name (str) – Original drug name

返回:

Preprocessed drug name

返回类型:

str

_get_rxcui_by_name(drug_name)[源代码]

Get RXCUI (RxNorm Concept Unique Identifier) by drug name.

参数:

drug_name (str) – The name of the drug to search for

返回:

Dictionary containing RXCUI information or error

返回类型:

Dict[str, Any]

_get_all_names_by_rxcui(rxcui)[源代码]

Get all names associated with an RXCUI, including generic names, brand names, and synonyms.

参数:

rxcui (str) – The RxNorm Concept Unique Identifier

返回:

Dictionary containing all names or error

返回类型:

Dict[str, Any]

run(arguments)[源代码]

Execute the RxNorm tool.

参数:

arguments (Dict[str, Any]) – Dictionary containing: - drug_name (str, required): The name of the drug to search for

返回:

  • rxcui: The RxNorm Concept Unique Identifier

  • names: List of all associated names (generic names, brand names, synonyms, etc.)

  • drug_name: The original drug name queried

  • processed_name: The preprocessed drug name used for search (if different)

返回类型:

Dictionary containing

class tooluniverse.SABIORKTool[源代码]

基类:BaseTool

Tool for querying SABIO-RK biochemical reaction kinetics database.

Retrieves kinetic parameters (Km, kcat, Vmax, Ki, etc.) with experimental conditions, organism, and literature references.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_build_query(arguments)[源代码]

Build SABIO-RK search query string from arguments.

_search_reactions(arguments)[源代码]

Search SABIO-RK for kinetic laws matching the query.

class tooluniverse.SASBDBRESTTool[源代码]

基类:BaseTool

SASBDB API tool for small-angle scattering (SAXS/SANS) data.

__init__(tool_config)[源代码]
_build_url(args)[源代码]

Build the full API URL, substituting path parameters.

_build_query_params(args)[源代码]

Return query parameters (those not used as path parameters).

run(arguments)[源代码]

Execute the SASBDB API request.

class tooluniverse.SASBDBSearchTool[源代码]

基类:BaseTool

SASBDB search tool - lists entries by molecular type or all entries.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SASBDBTextSearchTool[源代码]

基类:BaseTool

SASBDB search by text query — routes to UniProt lookup or molecular-type listing.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SAbDabTool[源代码]

基类:BaseTool

Tool for querying SAbDab structural antibody database.

SAbDab provides: - Antibody structures from PDB - CDR (complementarity-determining region) annotations - Heavy/light chain pairing information - Antigen binding information

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute SAbDab query based on operation type.

_search_structures(arguments)[源代码]

Search SAbDab for antibody structures.

参数:

arguments (Dict[str, Any]) – Dict containing: - query: Search query (antigen name, species, etc.) - limit: Maximum results

_get_structure(arguments)[源代码]

Get antibody structure details by PDB ID.

参数:

arguments (Dict[str, Any]) – Dict containing: - pdb_id: 4-character PDB ID

_get_summary(arguments)[源代码]

Get SAbDab database summary statistics.

参数:

arguments (Dict[str, Any]) – Dict (no required parameters)

class tooluniverse.SCExpressionAtlasTool[源代码]

基类:BaseTool

Tool for querying EBI Single Cell Expression Atlas.

Supports listing single-cell RNA-seq experiments with metadata (species, cell counts, technology, factors) and searching for experiments where a gene is expressed at single-cell resolution.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the SCXA API call.

_list_experiments(arguments)[源代码]

List all single-cell RNA-seq experiments with optional filtering.

_search_gene(arguments)[源代码]

Search for SC experiments where a gene is expressed.

class tooluniverse.SCREENRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SGDTool[源代码]

基类:BaseTool

Tool for querying the Saccharomyces Genome Database (SGD).

SGD provides curated information about the budding yeast S. cerevisiae, including gene function, phenotypes, interactions, GO annotations, pathways, and literature.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the SGD API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_locus_overview(arguments)[源代码]

Get gene/locus overview from SGD by SGD ID.

_locus_phenotypes(arguments)[源代码]

Get phenotype annotations for a yeast gene.

_locus_go(arguments)[源代码]

Get Gene Ontology annotations for a yeast gene.

_locus_interactions(arguments)[源代码]

Get genetic and physical interactions for a yeast gene.

Search SGD for genes, GO terms, phenotypes, etc.

class tooluniverse.SIGNListGuidelinesTool[源代码]

基类:BaseTool

List SIGN (Scottish Intercollegiate Guidelines Network) clinical guidelines, optionally filtered by clinical topic/specialty. Returns up to limit guidelines from the full SIGN guidelines table.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SIGNORTool[源代码]

基类:BaseTool

Query SIGNOR for causal signaling relationships and pathways.

__init__(tool_config)[源代码]
_get_interactions(params)[源代码]

Get signaling interactions for a protein/entity.

_list_pathways(params)[源代码]

List all SIGNOR curated signaling pathways.

_get_pathway(params)[源代码]

Get interactions belonging to a specific SIGNOR pathway.

run(params)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SIGNSearchGuidelinesTool[源代码]

基类:BaseTool

Search SIGN (Scottish Intercollegiate Guidelines Network) clinical guidelines by keyword. Fetches the full SIGN guidelines table (84 guidelines as of 2024) and filters results client-side.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SIMBADAdvancedTool[源代码]

基类:BaseTool

Advanced SIMBAD queries using TAP (Table Access Protocol) for complex queries.

This tool allows ADQL (Astronomical Data Query Language) queries for more sophisticated database searches.

__init__(tool_config, tap_url='https://simbad.cds.unistra.fr/simbad/sim-tap/sync')[源代码]
run(arguments)[源代码]

Execute an ADQL query on SIMBAD via TAP.

参数:

arguments (Dict[str, Any]) – Dictionary containing ‘adql_query’ parameter

返回:

Dictionary containing query results

返回类型:

Dict[str, Any]

class tooluniverse.SIMBADTool[源代码]

基类:BaseTool

Query the SIMBAD astronomical database for object information.

SIMBAD (Set of Identifications, Measurements, and Bibliography for Astronomical Data) is a comprehensive database of astronomical objects beyond the Solar System.

__init__(tool_config, base_url='https://simbad.cds.unistra.fr/simbad/sim-script')[源代码]
run(arguments)[源代码]

Execute a SIMBAD query based on the provided arguments.

参数:

arguments (Dict[str, Any]) – Dictionary containing query parameters

返回:

Dictionary containing query results or error information

返回类型:

Dict[str, Any]

_query_by_name(arguments)[源代码]

Query SIMBAD by object name.

参数:

arguments (Dict[str, Any]) – Must contain ‘object_name’ parameter

返回:

Dictionary containing object information

返回类型:

Dict[str, Any]

_query_by_coordinates(arguments)[源代码]

Query SIMBAD by coordinates.

参数:

arguments (Dict[str, Any]) – Must contain ‘ra’, ‘dec’, and optional ‘radius’ parameters

返回:

Dictionary containing objects near the specified coordinates

返回类型:

Dict[str, Any]

_query_by_identifier(arguments)[源代码]

Query SIMBAD by identifier pattern.

参数:

arguments (Dict[str, Any]) – Must contain ‘identifier’ parameter

返回:

Dictionary containing matching objects

返回类型:

Dict[str, Any]

_get_format_string(output_format)[源代码]

Get SIMBAD format string based on requested output format.

参数:

output_format (str) – One of ‘basic’, ‘detailed’, or ‘full’

返回:

SIMBAD format string

返回类型:

str

_execute_query(script, query_description, max_results=None)[源代码]

Execute a SIMBAD script query.

参数:
  • script (str) – SIMBAD script to execute

  • query_description (str) – Description of the query for error messages

  • max_results (int | None) – Maximum number of results to return

返回:

Dictionary containing query results or error information

返回类型:

Dict[str, Any]

class tooluniverse.SMILESVerifyTool[源代码]

基类:BaseTool

Parse SMILES and compute/verify molecular properties without RDKit.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SRATool[源代码]

基类:BaseTool

Tool for searching NCBI SRA (Sequence Read Archive) for sequencing experiments, runs, and studies.

Supports keyword search, organism filtering, and retrieval of experiment metadata including platform, library strategy, and run statistics.

No authentication required.

__init__(tool_config)[源代码]
_get_with_retry(url, params, max_retries=3)[源代码]

GET request with retry on 429 rate limit.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

Search SRA for experiments by keyword, organism, strategy.

_get_experiment(arguments)[源代码]

Get detailed metadata for a specific SRA experiment by accession.

_parse_sra_summary(entry, uid)[源代码]

Parse SRA eSummary XML fields into structured data.

class tooluniverse.STITCHTool[源代码]

基类:BaseTool

Tool for querying STITCH database.

STITCH provides chemical-protein interaction data including: - Known drug-target interactions - Predicted chemical-protein interactions - Interaction scores and evidence - Network analysis data

No authentication required. Free for academic/research use.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the STITCH API call.

_get_interactions(arguments)[源代码]

Get chemical-protein interactions.

Endpoint: GET /json/interactions

_get_interactors(arguments)[源代码]

Get interaction partners for a chemical or protein.

Endpoint: GET /json/interactors

_resolve_identifiers(arguments)[源代码]

Resolve chemical/protein names to STITCH identifiers.

Endpoint: GET /json/resolve

class tooluniverse.STRINGExtTool[源代码]

基类:BaseTool

Extended STRING API tool for functional annotation queries.

Complements existing STRING tools (interactions, enrichment, network, PPI enrichment) by providing per-protein functional annotations from GO, KEGG, DISEASES, TISSUES, COMPARTMENTS, and other databases.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the STRING API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_functional_annotations(arguments)[源代码]

Get functional annotations for a protein from STRING.

_get_enrichment(arguments)[源代码]

Perform functional enrichment analysis on a set of proteins.

class tooluniverse.STRINGRESTTool[源代码]

基类:BaseTool

STRING Database REST API tool. Generic wrapper for STRING API endpoints defined in ppi_tools.json.

__init__(tool_config)[源代码]
_build_url()[源代码]

Build URL for STRING API request.

_build_params(arguments)[源代码]

Build parameters for STRING API request.

_make_request(url, params)[源代码]

Perform a GET request and handle common errors.

_parse_tsv_response(text)[源代码]

Parse TSV response from STRING API.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.SYNERGxDBTool[源代码]

基类:BaseTool

Tool for querying the SYNERGxDB drug combination synergy database.

SYNERGxDB is a comprehensive database integrating drug combination screening data from 9 major studies with synergy scores (Bliss, Loewe, HSA, ZIP) and pharmacogenomic biomarker associations.

Supported operations: - search_combos: Search drug combination synergy scores - get_combo_matrix: Get dose-response matrix data - list_drugs: List all drugs in the database - get_drug: Get drug details by ID - list_cell_lines: List all cell lines - list_datasets: List all screening datasets - get_combo_stats: Get per-dataset combination statistics

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the SYNERGxDB API tool with given arguments.

_make_request(endpoint, params=None)[源代码]

Make GET request to SYNERGxDB API.

_DATASET_NAME_TO_ID = {'CLOUD': 6, 'DECREASE': 9, 'MERCK': 1, 'MIT-MELANOMA': 7, 'NCI-ALMANAC': 2, 'STANFORD': 8, 'VISAGE': 10, 'YALE-PDAC': 4, 'YALE-TNBC': 5}
_TISSUE_ALIASES: Dict[str, str] = {'brca': 'breast', 'cns': 'brain', 'colon': 'colorectal', 'colon cancer': 'colorectal', 'colorectal cancer': 'colorectal', 'crc': 'colorectal', 'gastroesophageal': 'upper digestive tract', 'gbm': 'brain', 'glioblastoma': 'brain', 'glioma': 'brain', 'leukemia': 'blood', 'luad': 'lung', 'lymphoma': 'blood', 'melanoma': 'skin', 'nsclc': 'lung', 'rectal': 'colorectal', 'upper gi': 'upper digestive tract'}
_DRUG_SYNONYMS: Dict[str, str] = {'5 fluorouracil': 'fluorouracil', '5-fluorouracil': 'fluorouracil', '5-fu': 'fluorouracil', '5fu': 'fluorouracil', 'avastin': 'bevacizumab', 'carboplatin': 'carboplat', 'cis-platinum': 'diamminedichloroplatinum', 'cisplatin': 'diamminedichloroplatinum', 'gleevec': 'imatinib', 'herceptin': 'trastuzumab', 'iressa': 'gefitinib', 'platinol': 'diamminedichloroplatinum', 'rituxan': 'rituximab', 'sprycel': 'dasatinib', 'tarceva': 'erlotinib', 'taxol': 'paclitaxel', 'taxotere': 'docetaxel', 'velcade': 'bortezomib'}
_resolve_drug_id_by_name(name)[源代码]

Resolve a drug name to SYNERGxDB integer drug ID via client-side name matching.

Returns the first matching drug ID, or None if not found.

_search_combos(arguments)[源代码]

Search drug combination synergy scores.

_get_combo_matrix(arguments)[源代码]

Get dose-response matrix for a specific drug combination.

_list_drugs(arguments)[源代码]

List all drugs in the SYNERGxDB database.

_get_drug(arguments)[源代码]

Get drug details by ID.

_list_cell_lines(arguments)[源代码]

List all cell lines in the SYNERGxDB database.

_list_datasets(arguments)[源代码]

List all screening datasets in SYNERGxDB.

_get_combo_stats(arguments)[源代码]

Get per-dataset combination statistics.

class tooluniverse.ScientificCalculatorTool[源代码]

基类:BaseTool

General-purpose scientific calculators.

No external API calls. Provides: - DNA translation in all 3 reading frames - Molecular formula analysis and combustion analysis - Chemical equilibrium solver (Ksp, complex formation, common-ion) - Enzyme kinetics (Km/Vmax, Hill, Ki) - Statistical tests (chi-square, Fisher, regression, t-test)

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_translate_reading_frames(args)[源代码]
_analyze_formula(args)[源代码]
_combustion_analysis(args)[源代码]
_ksp_simple(args)[源代码]
_ksp_complex(args)[源代码]
_common_ion(args)[源代码]
_michaelis_menten(args)[源代码]
_hill(args)[源代码]
_inhibition(args)[源代码]
_chi_square(args)[源代码]
_fisher_exact(args)[源代码]
_linear_regression(args)[源代码]
_t_test(args)[源代码]
class tooluniverse.SearchSPLTool[源代码]

基类:BaseTool

根据多个筛选条件(drug_name/ndc/rxcui/setid/published_date)搜索SPL列表。返回原始的DailyMed API JSON(包括元数据和数据数组)。

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SemanticScholarPDFSnippetsTool[源代码]

基类:BaseTool

Fetch a paper’s PDF from Semantic Scholar and return bounded text snippets around user-provided terms. Uses markitdown to convert PDF to markdown text.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.SemanticScholarTool[源代码]

基类:BaseTool

用于在Semantic Scholar上搜索论文(包括摘要)的工具。

API key is read from environment variable SEMANTIC_SCHOLAR_API_KEY. Request an API key at: https://www.semanticscholar.org/product/api

Rate limits: - Without API key: 1 request/second - With API key: 100 requests/second

_last_request_time = 0.0
_rate_limit_lock = <unlocked _thread.lock object>
__init__(tool_config, base_url='https://api.semanticscholar.org/graph/v1/paper/search')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_enforce_rate_limit(has_api_key)[源代码]
_fetch_missing_abstract(paper_id)[源代码]
class tooluniverse.SequenceAnalyzeTool[源代码]

基类:BaseTool

Sequence analysis: residue counting, GC content, reverse complement, stats.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_resolve_sequence(arguments)[源代码]

Get sequence from arguments, fetching from UniProt if needed.

_count_residues(arguments)[源代码]
_gc_content(arguments)[源代码]
_reverse_complement(arguments)[源代码]
_stats(arguments)[源代码]
class tooluniverse.SiderTool[源代码]

基类:BaseTool

Tool for querying the SIDER drug side effects database.

SIDER contains information on marketed medicines and their recorded adverse drug reactions extracted from drug labels. It includes side effect frequencies, therapeutic indications, and MedDRA concept codes.

Supported operations: - search_drug: Search for a drug by name and get its SIDER ID - get_side_effects: Get side effects for a drug (with frequencies if available) - get_indications: Get therapeutic indications for a drug - get_drugs_for_side_effect: Find drugs associated with a specific side effect - search_side_effect: Search for a side effect by name

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the SIDER tool with given arguments.

_fetch_page(path)[源代码]

Fetch an HTML page from SIDER.

_search_drug(arguments)[源代码]

Search for a drug by name using SIDER’s search endpoint.

_get_side_effects(arguments)[源代码]

Get side effects for a drug by SIDER drug ID or drug name.

_get_indications(arguments)[源代码]

Get therapeutic indications for a drug.

_search_side_effect(arguments)[源代码]

Search for a side effect by name.

_get_drugs_for_side_effect(arguments)[源代码]

Find drugs associated with a specific side effect by MedDRA code.

class tooluniverse.SmolAgentTool[源代码]

基类:BaseTool

Wrap smolagents agents so they can be used as ToolUniverse tools.

Supports: - CodeAgent, ToolCallingAgent, Agent, ManagedAgent - Mixed tools: ToolUniverse tools and smolagents-native tools - Streaming integration with ToolUniverse stream callbacks

__init__(tool_config, tooluniverse=None)[源代码]
_get_api_key()[源代码]
_init_model()[源代码]
_import_smolagents_tool(class_name, import_path)[源代码]

Dynamically import smolagents tool class with helpful error messages.

_convert_tools()[源代码]

Convert mixed tool definitions to smolagents Tool instances.

_create_sub_agents(sub_configs)[源代码]

Recursively create sub-agent instances (for ManagedAgent).

_init_agent()[源代码]
run(arguments, stream_callback=None, **_)[源代码]

Execute the agent with optional streaming back into ToolUniverse.

Supports: - Streaming output (when stream_callback is provided and agent.stream_outputs=True) - Execution timeout (via agent_init_params.max_execution_time) - Thread-safe stdout/stderr redirection

class tooluniverse.SpliceAITool[源代码]

基类:BaseTool

SpliceAI and Pangolin Splice Prediction API tool.

Provides access to deep learning-based splice prediction scores from the Broad Institute’s SpliceAI Lookup service.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Route to operation handler based on config.

_normalize_variant(variant)[源代码]

Normalize variant format to chr-pos-ref-alt.

_validate_variant(variant)[源代码]

Validate variant format. Returns error message if invalid, None if valid.

_interpret_score(delta_score)[源代码]

Interpret SpliceAI delta score.

_predict_splice(arguments)[源代码]

Get SpliceAI predictions for a variant.

_predict_splice_pangolin(arguments)[源代码]

Get Pangolin splice predictions for a variant.

_get_max_delta(arguments)[源代码]

Get just the maximum delta score and interpretation for a variant.

class tooluniverse.SurvivalTool[源代码]

基类:BaseTool

Local survival analysis tools.

Implements: - Kaplan-Meier survival estimator - Log-rank test (Mantel-Cox) - Cox proportional hazards regression (basic)

No external API required. Uses numpy/scipy.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute survival analysis.

_km_estimator(durations, events)[源代码]

Compute Kaplan-Meier product-limit survival estimate with Greenwood 95% CI.

Returns (times, survival, at_risk, events_at_t, n_censored, ci_lower, ci_upper). All returned lists have the same length (N+1), with index 0 representing the baseline (t=0, S=1, all subjects at risk, zero events/censored).

95% confidence intervals use the log-log (complementary log-log) transformation, the default in R survfit() and recommended by Collett (2015):

Greenwood sum G = sum_j( d_j / (n_j * (n_j - d_j)) ) U = log(-log(S(t))) (complementary log-log) SE_U = sqrt(G) / |log(S(t))| (delta method) CI = [S(t)^exp(+1.96*SE_U), S(t)^exp(-1.96*SE_U)]

Result is naturally in (0, 1) without clamping. Edge cases: S=1 → CI=[1,1]; S=0 → CI=[0,0]; |log(S)| < 1e-10 → plain linear fallback to avoid numerical blow-up.

References: Collett (2015) Modelling Survival Data in Medical Research, §2.3;

Kalbfleisch & Prentice (2002) §1.3.

_kaplan_meier(arguments)[源代码]

Compute Kaplan-Meier survival estimate.

durations: list of observed times event_observed: list of 1 (event occurred) or 0 (censored) group_labels: optional list of group labels for stratified analysis

_log_rank_test(arguments)[源代码]

Perform Mantel-Cox log-rank test between two groups.

durations_a, events_a: Group A survival data durations_b, events_b: Group B survival data

_cox_regression(arguments)[源代码]

Fit Cox proportional hazards model.

durations: list of observed times event_observed: list of 0/1 event indicators covariates: dict of {covariate_name: [values]}

class tooluniverse.SwissADMETool[源代码]

基类:BaseTool

Tool for computing ADMET properties and drug-likeness using SwissADME.

Supported operations: - calculate_adme: Compute full ADMET property profile for a SMILES molecule - check_druglikeness: Quick drug-likeness filter check

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the SwissADME tool with given arguments.

_submit_and_get_csv(smiles, name=None)[源代码]

Submit SMILES to SwissADME and retrieve the CSV results.

Returns the CSV text content on success, or None on failure.

_parse_csv_row(csv_text)[源代码]

Parse the CSV text into a structured dictionary.

_calculate_adme(arguments)[源代码]

Compute full ADMET property profile for a SMILES molecule.

Posts the SMILES to SwissADME, fetches the generated CSV result, and parses it into a structured dictionary with 49 properties.

_check_druglikeness(arguments)[源代码]

Quick drug-likeness filter check for a SMILES molecule.

Computes ADME properties and evaluates drug-likeness rules. Optionally filters to specific rules.

class tooluniverse.SwissDockTool[源代码]

基类:AsyncPollingTool

Tool for molecular docking using SwissDock REST API with AsyncPollingTool base class.

SwissDock performs protein-ligand docking using: - Attracting Cavities 2.0 (default) - cavity-based docking - AutoDock Vina - blind or targeted docking

Now uses AsyncPollingTool for automatic polling, progress reporting, and timeout management.

poll_interval: int = 5
max_duration: int = 600
__init__(tool_config)[源代码]

Initialize SwissDock tool with configuration.

_check_server_status()[源代码]

Check if SwissDock server is operational (synchronous).

_generate_session_id()[源代码]

Generate a unique session ID for the docking job.

_prepare_ligand(session_id, ligand_smiles)[源代码]

Prepare ligand from SMILES (raises on error).

_prepare_target(session_id, pdb_id)[源代码]

Prepare target protein from PDB ID (raises on error).

_set_docking_parameters(session_id, exhaustiveness=8, box_center=None, box_size=None, docking_engine='attracting_cavities')[源代码]

Set docking parameters (raises on error).

_start_docking(session_id)[源代码]

Start the docking job (raises on error).

_STATUS_KEYWORD_MAP = [(('COMPLETE', 'FINISHED', 'DONE'), 'FINISHED'), (('RUNNING', 'PROGRESS'), 'RUNNING'), (('ERROR', 'FAIL'), 'ERROR')]
_check_status_api(session_id)[源代码]

Check docking job status (returns status dict).

_retrieve_results(session_id)[源代码]

Retrieve docking results (raises on error).

submit_job(arguments)[源代码]

Submit docking job through multi-step workflow.

This handles the complete SwissDock workflow: 1. Check server status 2. Prepare ligand from SMILES 3. Prepare target protein 4. Set docking parameters 5. Start docking job

Returns session_id for polling.

check_status(job_id)[源代码]

Check SwissDock job status and retrieve results if complete.

参数:

job_id (str) – Session ID from submit_job()

返回:

  • done (bool): True if complete

  • result (any): Results if done

  • progress (int): Progress percentage

  • error (str): Error message if failed

返回类型:

Dict with keys

format_result(result)[源代码]

Format SwissDock results into standard response format.

_OPERATION_HANDLERS = {'check_job_status': '_check_job_status_operation', 'retrieve_results': '_retrieve_results_operation'}
async run(arguments, progress=None)[源代码]

Execute the SwissDock API call.

Routes to appropriate operation handler based on tool configuration.

async _check_job_status_operation(arguments)[源代码]

Check the status of a docking job by session ID (instant operation).

async _retrieve_results_operation(arguments)[源代码]

Retrieve results for a completed docking job (instant operation).

_abc_impl = <_abc._abc_data object>
class tooluniverse.SwissModelTool[源代码]

基类:BaseTool

Tool for querying the SWISS-MODEL Repository.

Provides pre-computed protein homology models for UniProt entries, including template structures, sequence coverage, quality metrics, and download coordinates.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the SWISS-MODEL API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_get_models(arguments)[源代码]

Get all available homology models for a UniProt accession.

_get_model_summary(arguments)[源代码]

Get a summary of the best available model for a UniProt accession.

class tooluniverse.SwissTargetTool[源代码]

基类:BaseTool

Tool for predicting protein targets of small molecules using SwissTargetPrediction.

SwissTargetPrediction uses a combination of 2D (FP2, MACCS, Morgan) and 3D (Electroshape) similarity measures to predict the most probable macromolecular targets of a small molecule.

Supported operations: - predict: Predict protein targets for a given SMILES - get_organisms: List supported organisms for prediction

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the SwissTargetPrediction tool with given arguments.

_predict(arguments)[源代码]

Predict protein targets for a SMILES molecule.

Workflow: 1. POST SMILES + organism to predict.php (streamed response) 2. Extract job redirect URL from the last <script> tag 3. GET result.php?job=X&organism=Y to fetch results 4. Parse the HTML DataTable into structured data

_get_organisms(arguments)[源代码]

Return the list of supported organisms.

_extract_job_url(html)[源代码]

Extract the result page URL from the streamed predict.php response.

The predict.php response uses chunked transfer encoding to stream progress updates. The final chunk contains a JavaScript redirect: location.replace(”http://www.swisstargetprediction.ch/result.php?job=XXXX&organism=Y”);

_parse_result_table(html)[源代码]

Parse the HTML result table from result.php.

The table has columns: Target | Common name | Uniprot ID | ChEMBL ID | Target Class | Probability* | Known actives (3D/2D)

class tooluniverse.SynBioHubTool[源代码]

基类:BaseTool

Tool for querying SynBioHub, a synthetic biology parts repository.

SynBioHub hosts the iGEM Registry (20,000+ BioBricks), as well as other public collections of genetic parts and designs encoded in SBOL format. Parts include promoters, coding sequences (CDS), terminators, ribosome binding sites (RBS), reporters (GFP, RFP, LacZ), regulatory elements, and composite devices.

Supports: search parts by keyword, list collections, get part SBOL data.

No authentication required for public collections.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the SynBioHub API call.

_query(arguments)[源代码]

Route to appropriate SynBioHub endpoint.

Search SynBioHub for genetic parts by keyword.

_get_collections(arguments)[源代码]

List public collections available on SynBioHub.

_get_part(arguments)[源代码]

Get detailed SBOL information for a specific genetic part.

static _find_text(parent, tag, ns)[源代码]

Find text content of an XML element.

class tooluniverse.T3DBTool[源代码]

基类:BaseTool

Tool for querying the Toxin and Toxin-Target Database (T3DB).

Supported operations: - get_toxin: Get detailed toxin info by T3DB ID - search_toxins: Search toxins by name

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_get_toxin(arguments)[源代码]
_search_toxins(arguments)[源代码]
class tooluniverse.TCDBTool[源代码]

基类:BaseTool

Tool for querying TCDB (Transporter Classification Database).

Supports lookup by UniProt accession, family search by TC# or name, and substrate-based search. Data is fetched from bulk flat files and cached in memory.

_cache: dict = {}
__init__(tool_config)[源代码]
_fetch_and_cache(key, url)[源代码]

Fetch a bulk data file and cache it. Returns raw text.

_get_acc2tcid()[源代码]

Parse acc2tcid into {uniprot_acc: [tc_numbers]}.

_get_families()[源代码]

Parse families into {family_id: description}.

_get_substrates()[源代码]

Parse substrates into list of {tc_number, substrates: [{chebi_id, name}]}.

_get_pdb_mapping()[源代码]

Parse PDB data into {tc_number: [pdb_ids]}.

_get_human_transporters()[源代码]

Parse human.csv into {uniprot_acc: {name, symbol, aliases, tc_number}}.

_family_for_tc(tc_number, families)[源代码]

Find the family description for a TC number by matching prefixes.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_get_transporter(arguments)[源代码]

Look up transporter info by UniProt accession.

_search_family(arguments)[源代码]

Search families by TC family ID prefix or name text.

_search_by_substrate(arguments)[源代码]

Search transporters by substrate name.

class tooluniverse.TIMERTool[源代码]

基类:BaseTool

Replicates TIMER2.0 tumor immune estimation using cBioPortal TCGA data.

Since TIMER3.0 no longer has a public REST API, this tool queries cBioPortal (www.cbioportal.org) for TCGA expression and survival data and computes equivalent statistics locally.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_resolve_study(cancer)[源代码]
_get_mrna_profile(study_id)[源代码]
_get_samples(study_id, n=200)[源代码]
_get_gene_id(symbol)[源代码]
_get_expression(profile_id, entrez_ids, sample_ids)[源代码]
_get_os_data(study_id)[源代码]
_immune_estimation(arguments)[源代码]
_gene_correlation(arguments)[源代码]
_survival_association(arguments)[源代码]
class tooluniverse.TRIPDatabaseTool[源代码]

基类:BaseTool

Search TRIP Database (Turning Research into Practice). Specialized evidence-based medicine database with clinical guidelines filter.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_search_trip_database(query, limit, search_type)[源代码]

Search TRIP Database for clinical guidelines.

_fetch_guideline_content(url)[源代码]

Extract content from a guideline URL using targeted parsers when available.

_clean_generic_content(raw_text)[源代码]

Clean generic text content to emphasise clinical lines.

_extract_bmj_guideline_content(url)[源代码]

Fetch BMJ Rapid Recommendation content with key recommendations.

_extract_dmj_guideline_content(url)[源代码]

Fetch Diabetes & Metabolism Journal guideline content and GRADE statements.

class tooluniverse.TermInfo[源代码]

基类:BaseModel

Basic term representation returned by OLS.

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

iri: HttpUrl
ontology_name: str
short_form: str
label: str
obo_id: str | None
is_obsolete: bool | None
_abc_impl = <_abc._abc_data object>
class tooluniverse.TermSearchResponse[源代码]

基类:PagedResponse

Paginated set of OLS terms.

num_found: int
terms: List[TermInfo]
_abc_impl = <_abc._abc_data object>
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class tooluniverse.TextDownloadTool[源代码]

基类:BaseTool

Download and return text content from URLs.

Optimized for text files - returns content as string directly. Supports encoding detection and normalization.

Expects: {“url”: “https://…”} Optional: {“encoding”: “utf-8”, “timeout”: seconds} Returns: {“content”: “text content”, “encoding”: “utf-8”}

__init__(tool_config)[源代码]
run(arguments)[源代码]

Download text content from URL.

参数:

arguments (Dict[str, Any]) – Dictionary containing url and optional parameters

返回:

Dictionary with content and encoding, or error

返回类型:

Dict[str, Any]

class tooluniverse.TheraSAbDabTool[源代码]

基类:BaseTool

Tool for querying Thera-SAbDab therapeutic antibody database.

Provides access to: - WHO INN therapeutic antibody names - Heavy/light chain sequences - Target antigens - Clinical trial status - PDB structural coverage

No authentication required.

_therapeutics_cache = None
__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Thera-SAbDab API call.

_parse_search_results(html)[源代码]

Parse Thera-SAbDab search results from HTML.

_load_all_therapeutics()[源代码]

Load all therapeutics from Thera-SAbDab (with caching).

_search_therapeutics(arguments)[源代码]

Search therapeutic antibodies by name or keyword.

Searches the Thera-SAbDab database for matching therapeutics.

_get_all_therapeutics(arguments)[源代码]

Get summary of all therapeutic antibodies in Thera-SAbDab.

Returns count and sample of therapeutics by format and phase.

_search_by_target(arguments)[源代码]

Search therapeutic antibodies by target antigen.

Useful for finding all approved/clinical antibodies against a target.

class tooluniverse.ThreeDBeaconsTool[源代码]

基类:BaseTool

Tool for 3D Beacons Hub API providing aggregated 3D structure models from multiple providers for a given UniProt protein accession.

Aggregates experimental structures (PDBe), predicted models (AlphaFold DB), homology models (SWISS-MODEL), conformational ensembles (PED), and more.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the 3D Beacons API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_structure_summary(arguments)[源代码]

Get summary of all 3D structures/models for a UniProt protein.

_get_structures(arguments)[源代码]

Get detailed structure list for a UniProt protein.

class tooluniverse.ToolFinderEmbedding[源代码]

基类:BaseTool

一种工具查找模型,使用RAG(检索增强生成)通过语义相似性搜索,根据用户查询查找相关工具。

该类利用句子转换器对工具描述进行编码,并通过基于嵌入的相似性匹配,为给定的查询找到最相关的工具。

rag_model_name

嵌入句子转换器模型的名称

类型:

str

rag_model

加载的句子转换器模型

类型:

句子转换器

tool_desc_embedding

工具描述的缓存嵌入

类型:

torch.Tensor

tool_name

可用工具名称列表

类型:

列表

tool_embedding_path

缓存工具嵌入文件的路径

类型:

str

special_tools_name

排除结果的特殊工具列表

类型:

列表

tooluniverse

参考包含所有工具的工具库

__init__(tool_config, tooluniverse)[源代码]

使用配置和RAG模型初始化ToolFinderEmbedding。

参数:

tool_config (dict) – 工具的配置字典

_maybe_refresh_embeddings()[源代码]

Check if the tool list has changed and refresh embeddings if needed.

This method is called before each Tool_RAG query to ensure the embeddings are up-to-date with the currently loaded tools. This is critical when using Tool_RAG via HTTP API where tools are loaded dynamically.

load_rag_model()[源代码]

加载用于基于RAG的工具检索的句子转换器模型。

将模型配置为适当的序列长度和分词器设置,以优化工具描述编码的性能。

The model is automatically moved to GPU if available for faster inference.

抛出:

ImportError – If sentence-transformers is not installed.

load_tool_desc_embedding(tooluniverse, include_names=None, exclude_names=None, include_categories=None, exclude_categories=None)[源代码]

从工具库中加载或生成工具描述的嵌入数据。

此方法会从磁盘加载缓存的嵌入向量,或者通过编码所有工具描述生成新的嵌入向量。嵌入向量会被缓存到磁盘,以加快后续加载速度。在生成嵌入向量后,会适当清理内存以避免出现内存溢出(OOM)问题。

参数:
  • tooluniverse – ToolUniverse 实例,包含所有可用工具

  • include_names (list, optional) – 特定工具名称包括

  • exclude_names (list, optional) – 要排除的工具名称

  • include_categories (list, optional) – 工具类别包括

  • exclude_categories (list, optional) – 要排除的工具类别

rag_infer(query, top_k=5)[源代码]

执行 RAG 推理以查找与给定查询最相关的工具。

利用查询嵌入与预先计算的工具嵌入之间的语义相似性来识别最相关的工具。

参数:
  • query (str) – 用户查询或所需功能的描述

  • top_k (int, optional) – 返回的顶级工具数量。默认为5。

退货

list: List of top-k tool names ranked by relevance to the query

抛出:
find_tools(message=None, picked_tool_names=None, rag_num=5, return_call_result=False, categories=None)[源代码]

根据消息或预先选择的工具名称查找相关工具。

此方法通过RAG推理根据消息查找工具,或处理预先选择的工具名称列表。它会过滤掉特殊工具,并返回适用于代理工作流程的工具提示。

参数:
  • message (str, optional) – 查询消息以查找工具。如果 picked_tool_names 为 None,则此项为必填。

  • picked_tool_names (list, optional) – 预先选择的工具名称以进行处理。如果消息为 None,则此项为必填。

  • rag_num (int, optional) – 筛选后返回的工具数量。默认值为5。

  • return_call_result (bool, optional) – 如果为 True,则返回提示和工具名称。默认为 False。

  • categories (list, optional) – 工具类别筛选列表。目前尚未针对基于嵌入的搜索实现。

退货
str or tuple:
  • 如果 return_call_result 为 False:工具将以格式化字符串的形式提示

  • 如果 return_call_result 为 True:返回 (tool_prompts, tool_names) 的元组

抛出:

AssertionError – 如果 message 和 picked_tool_names 都为 None

run(arguments)[源代码]

根据标准工具接口,使用给定的参数运行工具查找器。

这是使用ToolFinderEmbedding作为标准工具的主要入口。它从参数字典中提取参数,并委托给find_tools()函数处理。

参数:

arguments (dict) – 包含以下内容的字典: - **description**(字符串,可选):查询消息,用于查找工具(对应“message”) - **limit**(整数,可选):返回的工具数量(对应“rag_num”)。默认为 5。 - **picked_tool_names**(列表,可选):预先选择的工具名称,用于处理 - **return_call_result**(布尔值,可选):是否同时返回提示和名称。默认为 False。 - **categories**(列表,可选):用于筛选的工具类别列表

class tooluniverse.ToolFinderKeyword[源代码]

基类:BaseTool

高级基于关键词的工具查找器,采用复杂的文本处理技术和TF-IDF评分算法。

该类实现了用于工具发现的自然语言处理技术,包括: - 分词和规范化 - 停用词移除 - 基本词干提取 - TF-IDF 相关性评分 - 语义短语匹配

搜索通过解析用户查询以提取关键术语,将其通过自然语言处理(NLP)管道进行处理,并与预先构建的工具元数据索引进行匹配,从而实现高效且相关的工具发现。

STOP_WORDS = {'a', 'all', 'an', 'and', 'any', 'are', 'as', 'at', 'be', 'boy', 'but', 'by', 'came', 'can', 'day', 'did', 'do', 'down', 'each', 'for', 'from', 'get', 'had', 'has', 'have', 'he', 'how', 'if', 'in', 'is', 'it', 'its', 'long', 'made', 'may', 'new', 'no', 'now', 'number', 'of', 'old', 'on', 'part', 'said', 'see', 'that', 'the', 'their', 'they', 'this', 'time', 'to', 'two', 'up', 'use', 'was', 'way', 'what', 'which', 'who', 'will', 'with', 'your'}
STEMMING_RULES = [('ies', 'y'), ('ied', 'y'), ('ying', 'y'), ('ing', ''), ('ly', ''), ('ed', ''), ('ies', 'y'), ('ier', 'y'), ('iest', 'y'), ('s', ''), ('es', ''), ('er', ''), ('est', ''), ('tion', 't'), ('sion', 's'), ('ness', ''), ('ment', ''), ('able', ''), ('ible', ''), ('ful', ''), ('less', ''), ('ous', ''), ('ive', ''), ('al', ''), ('ic', ''), ('ize', ''), ('ise', ''), ('ate', ''), ('fy', ''), ('ify', '')]
__init__(tool_config, tooluniverse=None)[源代码]

初始化高级基于关键字的工具查找器。

参数:
  • tool_config (dict) – 工具的配置字典

  • tooluniverse – 引用包含所有工具的 ToolUniverse 实例

_tokenize_and_normalize(text)[源代码]

Tokenize text and apply normalization including stop word removal and stemming.

参数:

text (str) – Input text to tokenize

退货

List[str]: List of processed tokens

_apply_stemming(word)[源代码]

Apply basic stemming rules to reduce words to their root form.

参数:

word (str) – Word to stem

退货

str: Stemmed word

_extract_phrases(tokens, max_phrase_length=3)[源代码]

Extract meaningful phrases from tokens for better semantic matching.

参数:
  • tokens (List[str]) – Tokenized words

  • max_phrase_length (int) – Maximum length of phrases to extract

退货

List[str]: List of phrases and individual tokens

_build_tool_index(tools)[源代码]

Build TF-IDF index for all tools to enable efficient relevance scoring.

参数:

tools (List[Dict]) – List of tool configurations

_extract_parameter_text(parameter_schema)[源代码]

Extract searchable text from parameter schema.

Only parameter names are indexed (not their free-text descriptions). Parameter descriptions often contain boilerplate phrases like “Whether to include usage examples and quick start guide” that appear identically across many tools, inflating term frequencies for words like “guide” and producing false matches for domain-specific queries (e.g. “CRISPR guide RNA design”). Parameter names (e.g. “sequence_type”, “gene_id”, “format”) are more discriminating and carry genuine signal about tool capabilities.

参数:

parameter_schema (Dict) – Tool parameter schema

退货

List[str]: List of parameter name text elements

_calculate_tfidf_score(query_terms, tool_name)[源代码]

Calculate BM25-based relevance score for a tool given query terms.

BM25 (Best Match 25) is a bag-of-words retrieval function that improves on plain TF-IDF by incorporating document-length normalization directly into the term-frequency saturation formula. This eliminates the bias where short tool descriptions (few tokens) score disproportionately high because their TF values are inflated by a small denominator.

BM25 term score for a single term t in document d:

IDF(t) * (tf * (k1 + 1)) / (tf + k1 * (1 - b + b * dl / avgdl))

where:

tf = raw count of term in document dl = document length (raw token count, not phrase count) avgdl = average document length across all indexed tools k1 = term-frequency saturation parameter (default 1.5) b = document-length normalization strength (default 0.75)

Using raw_token_count (word-only length, without bigrams/trigrams) as dl so that phrase expansion does not double-penalize longer documents.

参数:
  • query_terms (List[str]) – Processed query terms and phrases

  • tool_name (str) – Name of the tool to score

退货

float: BM25 relevance score

_calculate_exact_match_bonus(query, tool)[源代码]

Calculate bonus score for exact matches in tool name or key phrases.

Tool names use underscores as word separators (e.g. “BLAST_nucleotide_search”), so the query is also checked in its underscore-normalized form so that “UniProt search” correctly matches “uniprot_search”.

Individual query tokens are also checked against the tool name so that a query like “sequence alignment BLAST” gives a bonus to BLAST_nucleotide_search even though the full query string does not appear literally in the name.

参数:
  • query (str) – Original query string

  • tool (Dict) – Tool configuration

退货

float: Exact match bonus score

find_tools(message=None, picked_tool_names=None, rag_num=5, return_call_result=False, categories=None)[源代码]

根据消息或预先选择的工具名称查找相关工具。

此方法与其他工具查找器的接口保持一致,以确保无缝替换。它使用基于关键字的搜索,而非嵌入相似性搜索。

参数:
  • message (str, optional) – 查询消息以查找工具。如果 picked_tool_names 为 None,则此项为必填。

  • picked_tool_names (list, optional) – 预先选择的工具名称以进行处理。如果消息为 None,则此项为必填。

  • rag_num (int, optional) – 筛选后返回的工具数量。默认值为5。

  • return_call_result (bool, optional) – 如果为 True,则返回提示和工具名称。默认为 False。

  • categories (list, optional) – 工具类别筛选列表

退货
str or tuple:
  • 如果 return_call_result 为 False:工具将以格式化字符串的形式提示

  • 如果 return_call_result 为 True:返回 (tool_prompts, tool_names) 的元组

抛出:

AssertionError – 如果 message 和 picked_tool_names 都为 None

run(arguments)[源代码]

使用基于高级关键词的搜索功能,结合NLP处理和TF-IDF评分来查找工具。

此方法提供了与其他工具查找器兼容的统一接口。

参数:

arguments (dict) – 字典包含: - description(字符串):搜索查询字符串(统一参数名称) - categories(列表,可选):用于筛选的类别列表 - limit(整数,可选):返回结果的最大数量(默认值:10) - picked_tool_names(列表,可选):预选的工具名称列表 - return_call_result(布尔值,可选):是否同时返回提示和名称。默认值为 False。

退货
str or tuple:
  • 如果 return_call_result 为 False:工具将以格式化字符串的形式提示

  • 如果 return_call_result 为 True:返回 (tool_prompts, tool_names) 的元组

Original JSON-based search implementation for backward compatibility.

参数:

arguments (dict) – Search arguments

退货

str: JSON string containing search results with relevance scores

class tooluniverse.ToolFinderLLM[源代码]

基类:BaseTool

基于LLM的工具查找器,利用自然语言处理技术选择相关工具。

此类利用AgenticTool的LLM功能来分析工具描述并将其与用户查询匹配。通过仅向LLM发送必要信息(工具名称和描述),优化了上下文窗口成本,提供了一种智能的替代方案,以替代基于嵌入的相似性搜索。

成本优化: - 在LLM提示中仅包含工具名称和描述 - 使用紧凑格式以最小化Token使用量 - 排除不必要的工具元数据和参数 - 实现缓存以避免重复的工具处理

__init__(tool_config, tooluniverse=None)[源代码]

初始化基于LLM的工具查找器。

参数:
  • tool_config (dict) – 包含LLM设置和提示的配置字典

  • tooluniverse – 引用包含所有工具的 ToolUniverse 实例

_init_agentic_tool()[源代码]

Initialize the underlying AgenticTool for LLM operations.

_get_tool_selection_prompt()[源代码]

Get the prompt template for tool selection. Optimized for minimal token usage.

_get_available_tools(force_refresh=False)[源代码]

Get available tools with their descriptions, with caching.

参数:

force_refresh (bool) – Whether to force refresh the cache

退货

list: List of tool dictionaries with names and descriptions

_prefilter_tools_by_keywords(available_tools, query, max_tools=100)[源代码]

Pre-filter tools using keyword matching to reduce context size before LLM processing.

参数:
  • available_tools (list) – All available tools

  • query (str) – User query

  • max_tools (int) – Maximum number of tools to send to LLM

退货

list: Filtered list of tools

_format_tools_for_prompt(tools)[源代码]

Format tools for inclusion in the LLM prompt with minimal information to reduce context cost. Only includes name and description to minimize token usage.

参数:

tools (list) – List of tool dictionaries

退货

str: Compact formatted tool descriptions for the prompt

find_tools_llm(query, limit=5, include_reasoning=False, categories=None)[源代码]

使用基于LLM的选择功能查找相关工具。

参数:
  • query (str) – 用户查询描述所需功能

  • limit (int) – 返回的工具最大数量

  • include_reasoning (bool) – 是否包含选择理由

  • categories (list, optional) – 工具类别筛选列表

退货

dict: Dictionary containing selected tools and metadata

find_tools(message=None, picked_tool_names=None, rag_num=5, return_call_result=False, categories=None, return_list_only=None)[源代码]

根据消息或预先选择的工具名称查找相关工具。

此方法与原始的ToolFinderEmbedding接口保持一致,以确保无缝替换。它使用基于LLM的选择方法,而非嵌入相似性。

参数:
  • message (str, optional) – 查询消息以查找工具。如果 picked_tool_names 为 None,则此项为必填。

  • picked_tool_names (list, optional) – 预先选择的工具名称以进行处理。如果消息为 None,则此项为必填。

  • rag_num (int, optional) – 筛选后返回的工具数量。默认值为5。

  • return_call_result (bool, optional) – 如果为 True,则返回提示和工具名称。默认为 False。

  • categories (list, optional) – 工具类别筛选列表。在选择LLM之前应用。

  • return_list_only (bool, optional) – 如果为 True,则仅返回工具规格列表。此选项会覆盖其他返回选项。

退货
str, tuple, or list:
  • 如果 return_list_only 为 True:工具规格列表

  • 如果 return_call_result 为 False:工具将以格式化字符串的形式提示

  • 如果 return_call_result 为 True:返回 (tool_prompts, tool_names) 的元组

抛出:

AssertionError – 如果 message 和 picked_tool_names 都为 None

get_tool_stats()[源代码]

获取可用工具的统计信息。

_format_as_json(result, query, limit, categories, return_call_result)[源代码]

Format the find_tools result as a standardized JSON string.

参数:
  • result – Result from find_tools method (either string, list, or tuple)

  • query – Original search query

  • limit – Requested number of tools

  • categories – Requested categories filter

  • return_call_result – Whether return_call_result was True

退货

str: JSON formatted search results

clear_cache()[源代码]

清除工具缓存以强制在下次访问时刷新。

run(arguments)[源代码]

根据标准工具接口,使用给定的参数运行工具查找器。

此方法现在默认返回JSON格式,以确保与其他搜索工具的一致性并简化与SMCP的集成。

参数:

arguments (dict) – 包含以下内容的字典: - **description**(字符串,可选):用于查询工具的消息(对应“message”) - **limit**(整数,可选):返回的工具数量(对应“rag_num”)。默认为5。 - **picked_tool_names**(列表,可选):预先选择要处理的工具名称 - **return_call_result**(布尔值,可选):是否同时返回提示和名称。默认为False。 - **return_format**(字符串,可选):返回格式为“json”(默认)或“legacy”(旧格式) - **return_list_only**(布尔值,可选):是否仅以列表形式返回工具规格 - **categories**(列表,可选):用于筛选的工具类别列表

find_tools_legacy(query, limit=5, include_reasoning=False, return_format='prompts')[源代码]

用于查找具有不同参数名称的工具的旧方法。

这为可能使用“query”而非“description”的任何代码提供了向后兼容性。

class tooluniverse.ToolUniversePageTool[源代码]

基类:BaseTool

Return the public ToolUniverse web page URL for a tool by its name.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.ToolUniverseTool[源代码]

基类:object

Adapter that wraps a ToolUniverse tool and exposes it as a smolagents Tool.

We create the real subclass dynamically to avoid hard dependency when the module is imported without smolagents installed.

static __new__(cls, *args, **kwargs)[源代码]
classmethod from_tooluniverse(tool_name, tooluniverse_instance, tool_config=None)[源代码]

Factory to create a smolagents-compatible Tool from a ToolUniverse tool.

This mirrors common factory patterns (e.g., from_langchain) and returns an instance of the dynamically constructed Tool subclass.

class tooluniverse.UCSCEpigenomicsTool[源代码]

基类:BaseTool

UCSC Genome Browser epigenomics-specific tools.

Provides access to: - CpG island annotations - ENCODE4 candidate cis-Regulatory Elements (cCREs) - Transcription Factor binding site clusters

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UCSC epigenomics API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint.

_ucsc_get_track(genome, track, chrom, start, end)[源代码]

Helper to fetch UCSC track data.

_get_cpg_islands(arguments)[源代码]

Get CpG island annotations for a genomic region.

_get_encode_ccres(arguments)[源代码]

Get ENCODE4 candidate cis-Regulatory Elements for a genomic region.

_get_tf_binding_clusters(arguments)[源代码]

Get TF binding site clusters from ENCODE3.

class tooluniverse.UCSCGenomeTool[源代码]

基类:BaseTool

Tool for querying the UCSC Genome Browser REST API.

Provides genomic search, DNA sequence retrieval, and annotation track data for 220+ genome assemblies (hg38, mm39, etc.).

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UCSC Genome Browser API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

Search UCSC Genome Browser for genes, transcripts, or features.

_get_sequence(arguments)[源代码]

Get DNA sequence for a specified genomic region.

_get_track(arguments)[源代码]

Get annotation track data for a specified genomic region.

class tooluniverse.UMLSRESTTool[源代码]

基类:BaseTool

Base class for UMLS REST API tools.

__init__(tool_config)[源代码]
_get_api_key()[源代码]

Get UMLS API key from environment variable.

_build_url(arguments)[源代码]

Build the full URL from endpoint template and arguments.

_make_request(arguments)[源代码]

Make request to UMLS API.

run(arguments)[源代码]

Execute the tool with given arguments.

class tooluniverse.URLHTMLTagTool[源代码]

基类:BaseTool

获取网页并提取指定HTML标签的内容。 预期输入:{“url”: “https://…”} 需提取的标签在工具配置中指定。 可选参数:{“timeout”: <秒>}(默认值为20) 返回值:{“content”: “<提取的内容>”} 或 {“error”: “…”}

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.URLToPDFTextTool[源代码]

基类:BaseTool

加载网页(包含 JavaScript),将其导出为 PDF,并提取文本。 期望输入:{“url”: “https://…”} 可选参数:{“timeout”: <秒>}(默认值为 30) 返回值:{“text”: “<提取的文本>”} 或 {“error”: “…”}

__init__(tool_config)[源代码]
_ensure_playwright_browsers(browsers=('chromium',), with_deps=False, timeout_seconds=600)[源代码]

Ensure Playwright browser binaries are installed.

退货

None on success, or an error string on failure.

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.USPTOOpenDataPortalTool[源代码]

基类:BaseTool

用于与USPTO开放数据门户API交互的工具,可用于搜索和检索专利信息。运行方法会根据提供的工具配置动态构建API请求。

__init__(tool_config, api_key=None, base_url='https://api.uspto.gov/api/v1')[源代码]

初始化 USPTOOpenDataPortalTool。

参数:
  • tool_config – 正在运行的特定工具的配置。

  • api_key – 您的USPTO开放数据门户API密钥。

  • base_url – USPTO API 的基础 URL。

get_by_path(d, keys)[源代码]

通过键列表安全地导航嵌套字典。

assign_by_path(d, path, value)[源代码]

为点路径创建嵌套字典,并将最终键设置为指定值。

prune_item(item, return_fields)[源代码]
run(arguments)[源代码]

根据工具的配置,构建并执行API调用以运行指定的工具。

参数:

arguments – 与工具定义中的参数相对应的工具参数字典。

退货

API 调用的结果,可以是字典(用于 JSON)或字符串(用于 CSV)。

class tooluniverse.UniChemTool[源代码]

基类:BaseTool

Tool for querying UniChem compound cross-referencing service.

Maps chemical identifiers across 40+ databases using InChIKey, source compound IDs, or UCIs (UniChem Compound Identifiers).

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UniChem API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_search_compound(arguments)[源代码]

Search UniChem for a compound by InChIKey, sourceID, or UCI.

_list_sources(arguments)[源代码]

List all chemical database sources in UniChem.

class tooluniverse.UniParcTool[源代码]

基类:BaseTool

Tool for querying UniProt UniParc sequence archive.

Supports: - Get UniParc entry by UPI identifier (cross-references, sequence features) - Search UniParc by gene name, organism, database membership

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UniParc API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_entry(arguments)[源代码]

Get UniParc entry by UPI identifier.

Search UniParc by gene, organism, or database.

class tooluniverse.UniProtIDMappingTool[源代码]

基类:BaseTool

Tool for converting identifiers between databases using the UniProt ID Mapping service.

Handles the async submit -> poll -> results workflow automatically. No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UniProt ID Mapping API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint.

_submit_and_poll(from_db, to_db, ids, tax_id=None)[源代码]

Submit a mapping job and poll for results.

_convert(arguments)[源代码]

Generic ID conversion between any supported databases.

_to_pdb(arguments)[源代码]

Convert UniProt accessions to PDB IDs.

_gene_to_uniprot(arguments)[源代码]

Convert gene names to UniProt accessions.

_list_databases(arguments)[源代码]

List available databases for ID mapping.

class tooluniverse.UniProtLocationsTool[源代码]

基类:BaseTool

Tool for querying the UniProt Subcellular Locations database.

Supports: - Get location details by ID (SL-XXXX) - Search locations by name or keyword

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UniProt Locations API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_parse_location(data)[源代码]

Parse a location entry into a clean structure.

_get_location(arguments)[源代码]

Get subcellular location details by ID.

_search_locations(arguments)[源代码]

Search subcellular locations by name or keyword.

class tooluniverse.UniProtRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
validate_parameters(arguments)[源代码]

Validate parameters with automatic type coercion for limit.

_build_url(args)[源代码]
_extract_data(data, extract_path)[源代码]

支持过滤功能的自定义数据提取

Handle search queries with flexible parameters

_handle_id_mapping(arguments)[源代码]

Handle ID mapping requests

Handle UniRef search queries

Handle UniParc search queries

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

get_entry_by_accession(accession)[源代码]
get_function_by_accession(accession)[源代码]
get_names_taxonomy_by_accession(accession)[源代码]
get_subcellular_location_by_accession(accession)[源代码]
get_disease_variants_by_accession(accession)[源代码]
get_ptm_processing_by_accession(accession)[源代码]
get_sequence_isoforms_by_accession(accession)[源代码]
class tooluniverse.UniProtRefTool[源代码]

基类:BaseTool

Tool for querying UniProt reference datasets (diseases, keywords, proteomes).

UniProt maintains curated controlled vocabularies that standardize protein annotations across the database. This tool provides access to: - Disease vocabulary: 6K+ curated disease entries with cross-refs to OMIM, MeSH, MedGen - Keyword vocabulary: 1.2K+ standardized terms for biological process, function, etc. - Proteomes: Reference proteome summaries with assembly and component data

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UniProt reference dataset API call.

_query(arguments)[源代码]

Route to appropriate UniProt reference endpoint.

_search_diseases(arguments)[源代码]

Search UniProt controlled disease vocabulary.

_get_disease(arguments)[源代码]

Get a specific disease entry by UniProt disease ID.

_search_keywords(arguments)[源代码]

Search UniProt keyword controlled vocabulary.

_get_keyword(arguments)[源代码]

Get a specific keyword entry by UniProt keyword ID.

_get_proteome(arguments)[源代码]

Get reference proteome information by UniProt proteome ID.

_search_proteomes(arguments)[源代码]

Search UniProt reference proteomes.

class tooluniverse.UniProtTaxonomyTool[源代码]

基类:BaseTool

Tool for querying UniProt taxonomy data.

Supports: - Get taxonomy details by NCBI taxon ID - Search taxonomy by name

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UniProt Taxonomy API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_taxon(arguments)[源代码]

Get taxonomy details by NCBI taxon ID.

Search taxonomy by name.

class tooluniverse.UniRefTool[源代码]

基类:BaseTool

Tool for querying UniProt UniRef protein sequence clusters.

Supports: - Get cluster details by ID (UniRef90_XXXXX, UniRef50_XXXXX, UniRef100_XXXXX) - Search clusters by protein name, gene, or organism

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the UniRef API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_cluster(arguments)[源代码]

Get UniRef cluster details by cluster ID.

_search_clusters(arguments)[源代码]

Search UniRef clusters by protein name, gene, or organism.

class tooluniverse.UnpaywallTool[源代码]

基类:BaseTool

Query Unpaywall by DOI to check open-access status, OA locations, and retrieve full-text URLs.

__init__(tool_config, base_url='https://api.unpaywall.org/v2/')[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_call_api(doi, email)[源代码]

Shared API call logic.

_check_oa_status(doi, email)[源代码]

Original OA status check.

static _extract_oa_location(loc)[源代码]

Extract relevant fields from a single OA location dict.

_get_full_text_url(doi, email)[源代码]

Retrieve full-text PDF and landing page URLs for a DOI.

class tooluniverse.UsageTipsTool[源代码]

基类:BaseTool

run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.VDJDBTool[源代码]

基类:BaseTool

Tool for querying the VDJdb T-cell receptor sequence database.

VDJdb is a curated database of TCR sequences with experimentally verified antigen specificity. It links CDR3 sequences to specific epitopes, MHC alleles, and antigen sources.

Supported operations: - search_cdr3: Search by CDR3 amino acid sequence - get_antigen_specificity: Search by epitope sequence - get_database_summary: Get database statistics

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the VDJdb API tool with given arguments.

_post_search(filters, page=None, page_size=25, paired=False, sort=None)[源代码]

Make a POST search request to VDJdb API.

_search_cdr3(arguments)[源代码]

Search VDJdb by CDR3 amino acid sequence.

_get_antigen_specificity(arguments)[源代码]

Search VDJdb by epitope sequence to find TCRs recognizing an antigen.

_get_database_summary(arguments)[源代码]

Get VDJdb database metadata and column information.

class tooluniverse.VisualizationTool[源代码]

基类:BaseTool

Base class for all visualization tools in ToolUniverse.

Provides common functionality for: - HTML generation and embedding - Static image conversion - Error handling - Output formatting

__init__(tool_config)[源代码]
create_visualization_response(html_content, viz_type, data=None, static_image=None, metadata=None)[源代码]

Create a standardized visualization response.

create_error_response(error_message, error_type='VisualizationError')[源代码]

Create a standardized error response.

convert_to_base64_image(image_data, format='PNG')[源代码]

Convert image data to base64 string.

create_plotly_html(fig, width=None, height=None, include_plotlyjs='cdn')[源代码]

Create HTML from Plotly figure.

create_py3dmol_html(viewer_html, width=None, height=None, title=None, info_cards='', control_panel='', toolbar='')[源代码]

Create modern HTML wrapper for py3Dmol viewer.

add_3d_controls_script()[源代码]

Add JavaScript for 3D viewer controls.

create_molecule_2d_html(molecule_image, molecule_info, width=None, height=None, title=None)[源代码]

Create modern HTML for 2D molecule visualization.

class tooluniverse.WFGYPromptBundleTool[源代码]

基类:BaseTool

Local prompt-bundle tool for triaging LLM/RAG failures via WFGY ProblemMap.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

static _build_system_prompt(audience, links)[源代码]
static _build_user_prompt(bug_description)[源代码]
class tooluniverse.WHOGHOQueryTool[源代码]

基类:WHOGHORESTTool

Tool for answering generic health questions using natural language.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute query tool with natural language processing.

class tooluniverse.WHOGHORESTTool[源代码]

基类:BaseTool

Base class for WHO Global Health Observatory (GHO) REST API tools.

__init__(tool_config)[源代码]
_make_request(params=None)[源代码]

Make request to WHO GHO API.

run(arguments)[源代码]

Execute the tool with given arguments.

static parse_query(query)[源代码]

Parse natural language query to extract health topic, country, year.

参数:

query (str) – Natural language query (e.g., “smoking rate in USA 2020”)

返回:

Dictionary with extracted: topic, country_code, year

返回类型:

dict

static rank_indicators(indicators, query)[源代码]

Rank indicators by relevance to query.

参数:
  • indicators (list) – List of indicator dictionaries

  • query (str) – Search query

返回:

Ranked list of indicators

返回类型:

list

static format_health_answer(value, indicator_name, country_code=None, year=None)[源代码]

Format health data into a human-readable answer.

参数:
  • value (Any) – Health statistic value

  • indicator_name (str) – Name of the indicator

  • country_code (str, optional) – Country code

  • year (int, optional) – Year

返回:

Formatted answer dictionary

返回类型:

dict

static is_value_available(value_obj)[源代码]

Check if a WHO data value is available.

Returns False when the API returns placeholders such as “Data not available” or when the numeric value is missing.

_make_request_for_data(params)[源代码]

Make request to data using direct indicator endpoint format.

class tooluniverse.WHOGHOStatisticTool[源代码]

基类:WHOGHORESTTool

Tool for getting health statistics by indicator name.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Get health statistic by indicator name.

class tooluniverse.WHOGHOTopicTool[源代码]

基类:WHOGHORESTTool

Tool for finding indicators by topic.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Find indicators by topic.

class tooluniverse.WHOGuidelineFullTextTool[源代码]

基类:BaseTool

Fetch full text content from WHO guideline pages. Takes a WHO publication URL and extracts content or PDF download link.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_fetch_who_guideline(url)[源代码]

Fetch WHO guideline content and PDF link.

class tooluniverse.WHOGuidelinesTool[源代码]

基类:BaseTool

WHO (World Health Organization) Guidelines Search Tool. Searches WHO official guidelines from their publications website.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_topic_slug(query)[源代码]

Convert search query to WHO health-topics URL slug candidates.

_scrape_topic_publications(topic_slug)[源代码]

Fetch WHO health topic page and extract publication links.

_search_who_guidelines(query, limit)[源代码]

Search WHO guidelines via WHO health-topics pages then general guidelines page.

class tooluniverse.WebAPIDocumentationSearchTool[源代码]

基类:WebSearchTool

Specialized web search tool for API documentation and Python libraries.

This tool is optimized for finding API documentation, Python packages, and technical resources using DDGS with multiple search engines.

run(arguments)[源代码]

Execute API documentation focused search.

参数:

arguments (Dict[str, Any]) – Dictionary containing: - query: Search query string - max_results: Maximum number of results (default: 10) - focus: Focus area (‘api_docs’, ‘python_packages’, etc.) - backend: Search engine backend (default: ‘auto’)

返回:

Dictionary containing search results

返回类型:

Dict[str, Any]

class tooluniverse.WebSearchTool[源代码]

基类:BaseTool

Web search tool using DDGS library.

This tool performs web searches using the DDGS library which supports multiple search engines including Google, Bing, Brave, Yahoo, DuckDuckGo, etc.

__init__(tool_config)[源代码]
_search_with_ddgs(query, max_results=10, backend='auto', region='us-en', safesearch='moderate')[源代码]

Perform a web search using DDGS library and return formatted results.

参数:
  • query (str) – Search query string

  • max_results (int) – Maximum number of results to return

  • backend (str) – Search engine backend (auto, google, bing, brave, etc.)

  • region (str) – Search region (e.g., ‘us-en’, ‘cn-zh’)

  • safesearch (str) – Safe search level (‘on’, ‘moderate’, ‘off’)

返回:

List of search results with title, url, and snippet

返回类型:

List[Dict[str, Any]]

_search_with_fallback(query, max_results, backend, region, safesearch)[源代码]

Search with backend fallback strategy.

返回:

(results, backend_used, attempted_backends, warning, provider_errors)

返回类型:

Tuple[List[Dict[str, Any]], str | None, List[str], str | None, Dict[str, str]]

_search_with_duckduckgo_html(query, max_results)[源代码]

Fallback provider: parse DuckDuckGo HTML results without DDGS.

_search_with_wikipedia_api(query, max_results)[源代码]

Fallback provider: Wikipedia OpenSearch API.

run(arguments)[源代码]

Execute web search using DDGS.

参数:

arguments (Dict[str, Any]) – Dictionary containing: - query: Search query string - max_results: Maximum number of results (default: 10) - search_type: Type of search (default: ‘general’) - backend: Search engine backend (default: ‘auto’) - region: Search region (default: ‘us-en’) - safesearch: Safe search level (default: ‘moderate’)

返回:

Dictionary containing search results

返回类型:

Dict[str, Any]

class tooluniverse.WikiPathwaysExtTool[源代码]

基类:BaseTool

Tool for WikiPathways extended API endpoints.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the WikiPathways API call.

_query(arguments)[源代码]

Route to appropriate endpoint.

_get_pathway_genes(arguments)[源代码]

Get all genes in a WikiPathways pathway.

_find_pathways_by_gene(arguments)[源代码]

Find pathways containing a specific gene.

class tooluniverse.WikiPathwaysGetTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.WikiPathwaysSearchTool[源代码]

基类:object

__init__(tool_config=None)[源代码]
run(arguments)[源代码]
class tooluniverse.WikidataSPARQLTool[源代码]

基类:BaseTool

Run SPARQL queries against Wikidata (powering Scholia views).

参数(参数):

sparql (str): SPARQL query string max_results (int): Optional result limit override

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.WikipediaContentTool[源代码]

基类:BaseTool

Extract content from Wikipedia articles using MediaWiki API.

参数(参数):

title (str): Article title (required) language (str): Wikipedia language code (default: “en”) extract_type (str): Type of content - “intro” (first paragraph),

“summary” (first few paragraphs), or “full” (entire article) (default: “summary”)

max_chars (int): Maximum characters for summary/extract

(default: 2000)

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.WikipediaSearchTool[源代码]

基类:BaseTool

Search Wikipedia articles using MediaWiki API.

参数(参数):

query (str): Search query string limit (int): Maximum number of results to return (default: 10, max: 50) language (str): Wikipedia language code (default: “en”)

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.WikipediaSummaryTool[源代码]

基类:BaseTool

Get a brief summary/introduction from a Wikipedia article.

This is a convenience tool that extracts just the first paragraph(s) of an article.

参数(参数):

title (str): Article title (required) language (str): Wikipedia language code (default: “en”) max_chars (int): Maximum characters to return (default: 500)

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.WoRMSRESTTool[源代码]

基类:BaseTool

__init__(tool_config)[源代码]
_build_url(args)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

class tooluniverse.WormBaseTool[源代码]

基类:BaseTool

Tool for querying WormBase, the C. elegans genome database.

Provides detailed gene information for C. elegans and other nematodes including phenotypes, expression data, orthologs, and functional annotations.

No authentication required.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the WormBase API call.

_dispatch(arguments)[源代码]

Route to appropriate endpoint based on config.

_gene_overview(arguments)[源代码]

Get detailed gene overview from WormBase by WBGene ID or gene name.

_gene_phenotypes(arguments)[源代码]

Get phenotype annotations for a C. elegans gene from WormBase.

_gene_expression(arguments)[源代码]

Get expression data for a C. elegans gene from WormBase.

class tooluniverse.XMLDatasetTool[源代码]

基类:BaseTool

用于搜索和筛选以可搜索记录集合形式组织的XML数据集(例如,医学主题或药物描述的数据集)的工具。支持用户友好的查询,无需掌握XPath知识。

__init__(tool_config)[源代码]
_load_dataset()[源代码]

Load and parse the XML dataset.

_get_dataset_path()[源代码]

Get the path to the XML dataset.

_extract_record_data(record_element)[源代码]

Extract data from a record element with caching.

_extract_field_value(element, xpath_expr)[源代码]

Extract field value using XPath expression.

_get_all_records_data()[源代码]

Get all records data with caching.

run(arguments)[源代码]

工具的主要入口点。

Search records by text content across multiple fields.

_find_matches(record_data, search_query, search_fields, case_sensitive, exact_match)[源代码]

Find matching fields in a record.

_get_searchable_value(record_data, field, case_sensitive)[源代码]

Get searchable string value for a field.

_is_match(field_value, search_query, exact_match)[源代码]

Check if field value matches search query.

_filter(arguments)[源代码]

Filter records based on field criteria.

_get_filter_function(condition, value)[源代码]

Get the appropriate filter function for the condition.

_get_filter_description(field, condition, value)[源代码]

Get human-readable filter description.

get_dataset_info()[源代码]

获取有关已加载 XML 数据集的全面信息。

tooluniverse.XMLTool

XMLDatasetTool 的别名

class tooluniverse.XenbaseTool[源代码]

基类:BaseTool

Tool for querying Xenopus gene data via the Alliance of Genome Resources.

Supported operations: - search_genes: Search Xenopus genes by name/symbol - get_gene: Get detailed gene information by Xenbase gene ID

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the Xenbase/Alliance API call.

_search_genes(arguments)[源代码]

Search for Xenopus genes by name or symbol.

_get_gene(arguments)[源代码]

Get detailed gene information by Xenbase gene ID.

class tooluniverse.ZenodoRESTTool[源代码]

基类:BaseRESTTool

Generic REST tool for Zenodo API endpoints.

_get_param_mapping()[源代码]

Map Zenodo-specific parameter names.

_process_response(response, url)[源代码]

Process Zenodo API response with search result handling.

class tooluniverse.ZincTool[源代码]

基类:BaseTool

Tool for querying the ZINC database of commercially available compounds.

ZINC is a free database of commercially-available compounds for virtual screening, maintained by the Irwin and Shoichet labs at UCSF.

Supported operations: - search_compounds: Search by name or keyword - get_compound: Get details for a ZINC ID (properties + vendors) - search_by_smiles: Search by SMILES string (exact or substructure) - get_purchasable: Browse purchasable compounds by availability tier - search_by_properties: Filter compounds by molecular properties

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute the ZINC API tool with given arguments.

_make_request(path, params=None)[源代码]

Make GET request to ZINC API.

_enrich_with_properties(zinc_ids)[源代码]

Fetch molecular properties from protomers endpoint for a list of ZINC IDs.

_search_compounds(arguments)[源代码]

Search compounds by name or keyword.

_get_compound(arguments)[源代码]

Get detailed compound information including properties and vendors.

_search_by_smiles(arguments)[源代码]

Search compounds by SMILES string.

_get_purchasable(arguments)[源代码]

Browse purchasable compounds by availability tier.

_search_by_properties(arguments)[源代码]

Filter compounds by molecular properties using protomers endpoint.

Since ZINC does not support property range filters as query params, this fetches a batch of protomers and filters client-side by the specified property ranges.

class tooluniverse.dbSNPGetFrequencies[源代码]

基类:dbSNPRESTTool

Get allele frequencies for a variant.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Get allele frequencies by rsID using E-utilities.

class tooluniverse.dbSNPGetVariantByRsID[源代码]

基类:dbSNPRESTTool

Get variant information by rsID.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Get variant by rsID using E-utilities.

class tooluniverse.dbSNPRESTTool[源代码]

基类:NCBIEUtilsTool

Base class for dbSNP REST API tools with rate limiting.

class tooluniverse.dbSNPSearchByGene[源代码]

基类:dbSNPRESTTool

Search variants by gene symbol.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Search variants by gene using E-utilities.

class tooluniverse.gnomADGetGeneConstraints[源代码]

基类:gnomADGraphQLTool

Get gene constraint metrics from gnomAD.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Get gene constraints.

class tooluniverse.gnomADGraphQLQueryTool[源代码]

基类:gnomADGraphQLTool

Generic gnomAD GraphQL tool driven by JSON config.

Config fields supported: - fields.query_schema: GraphQL query string - fields.variable_map: map tool argument names -> GraphQL variable names - fields.default_variables: default GraphQL variable values

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute GraphQL query with given arguments.

class tooluniverse.gnomADGraphQLTool[源代码]

基类:BaseTool

Base class for gnomAD GraphQL API tools.

__init__(tool_config)[源代码]
run(arguments)[源代码]

Execute GraphQL query with given arguments.

class tooluniverse.iPTMnetTool[源代码]

基类:BaseTool

Tool for querying the iPTMnet PTM network database.

Supported operations: - search: Search proteins by name/keyword with role and PTM type filters - get_ptm_sites: Get all PTM sites for a protein (phosphorylation, etc.) - get_proteoforms: Get proteoform records with specific PTM combinations - get_ptm_ppi: Get PTM-dependent protein-protein interactions

__init__(tool_config)[源代码]
_infer_operation(arguments)[源代码]

Infer operation from tool name when not explicitly provided.

run(arguments)[源代码]

Execute the iPTMnet API tool with given arguments.

_fetch_protein_data(uniprot_id, endpoint)[源代码]

Fetch data for a protein from iPTMnet. Returns parsed JSON or error dict.

Search proteins by name/keyword with optional role and PTM type filters.

_get_ptm_sites(arguments)[源代码]

Get all PTM sites for a protein by UniProt accession.

_get_proteoforms(arguments)[源代码]

Get proteoform records for a protein.

_get_ptm_ppi(arguments)[源代码]

Get PTM-dependent protein-protein interactions.

class tooluniverse.miRNAGetTool[源代码]

基类:BaseTool

Get detailed miRNA/lncRNA information from RNAcentral by ID. Returns sequence, species, RNA type, and database cross-references.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

_get_rna(arguments)[源代码]

Get RNA entry details including sequence.

_get_publications(arguments)[源代码]

Get publications associated with an RNA entry.

_get_xrefs(arguments)[源代码]

Get cross-references for an RNA entry.

class tooluniverse.miRNASearchTool[源代码]

基类:BaseTool

Search for miRNAs/lncRNAs/ncRNAs via EBI Search of RNAcentral. Can filter results by RNA type for focused results.

__init__(tool_config)[源代码]
run(arguments)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以便与大多数具体工具实现保持一致,这些工具通常期望输入为字典形式。

参数:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不支持这些参数的工具仍然可以正常运行——它们只会接收到 arguments 参数。

tooluniverse.__dir__()[源代码]

Dynamic directory listing. Includes standard globals plus all available tools.

tooluniverse.__getattr__(name)[源代码]

Dynamic dispatch for tool classes. This replaces the manual _LazyImportProxy list.

子包

子模块