tooluniverse 1.0.9.1__py3-none-any.whl → 1.0.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tooluniverse might be problematic. Click here for more details.
- tooluniverse/__init__.py +57 -1
- tooluniverse/admetai_tool.py +1 -1
- tooluniverse/agentic_tool.py +65 -17
- tooluniverse/base_tool.py +19 -8
- tooluniverse/blast_tool.py +132 -0
- tooluniverse/boltz_tool.py +3 -3
- tooluniverse/cache/result_cache_manager.py +167 -12
- tooluniverse/cbioportal_tool.py +42 -0
- tooluniverse/clinvar_tool.py +268 -74
- tooluniverse/compose_scripts/drug_safety_analyzer.py +1 -1
- tooluniverse/compose_scripts/multi_agent_literature_search.py +1 -1
- tooluniverse/compose_scripts/output_summarizer.py +4 -4
- tooluniverse/compose_scripts/tool_discover.py +1941 -443
- tooluniverse/compose_scripts/tool_graph_composer.py +1 -1
- tooluniverse/compose_scripts/tool_metadata_generator.py +1 -1
- tooluniverse/compose_tool.py +9 -9
- tooluniverse/core_tool.py +2 -2
- tooluniverse/ctg_tool.py +4 -4
- tooluniverse/custom_tool.py +1 -1
- tooluniverse/data/agentic_tools.json +0 -370
- tooluniverse/data/alphafold_tools.json +6 -6
- tooluniverse/data/blast_tools.json +112 -0
- tooluniverse/data/cbioportal_tools.json +87 -0
- tooluniverse/data/clinvar_tools.json +235 -0
- tooluniverse/data/compose_tools.json +0 -89
- tooluniverse/data/dbsnp_tools.json +275 -0
- tooluniverse/data/emdb_tools.json +61 -0
- tooluniverse/data/ensembl_tools.json +259 -0
- tooluniverse/data/file_download_tools.json +275 -0
- tooluniverse/data/geo_tools.json +200 -48
- tooluniverse/data/gnomad_tools.json +109 -0
- tooluniverse/data/gtopdb_tools.json +68 -0
- tooluniverse/data/gwas_tools.json +32 -0
- tooluniverse/data/interpro_tools.json +199 -0
- tooluniverse/data/jaspar_tools.json +70 -0
- tooluniverse/data/kegg_tools.json +356 -0
- tooluniverse/data/mpd_tools.json +87 -0
- tooluniverse/data/ols_tools.json +314 -0
- tooluniverse/data/package_discovery_tools.json +64 -0
- tooluniverse/data/packages/categorized_tools.txt +0 -1
- tooluniverse/data/packages/machine_learning_tools.json +0 -47
- tooluniverse/data/paleobiology_tools.json +91 -0
- tooluniverse/data/pride_tools.json +62 -0
- tooluniverse/data/pypi_package_inspector_tools.json +158 -0
- tooluniverse/data/python_executor_tools.json +341 -0
- tooluniverse/data/regulomedb_tools.json +50 -0
- tooluniverse/data/remap_tools.json +89 -0
- tooluniverse/data/screen_tools.json +89 -0
- tooluniverse/data/tool_discovery_agents.json +428 -0
- tooluniverse/data/tool_discovery_agents.json.backup +1343 -0
- tooluniverse/data/uniprot_tools.json +77 -0
- tooluniverse/data/web_search_tools.json +250 -0
- tooluniverse/data/worms_tools.json +55 -0
- tooluniverse/dataset_tool.py +2 -2
- tooluniverse/dbsnp_tool.py +196 -58
- tooluniverse/default_config.py +36 -3
- tooluniverse/emdb_tool.py +30 -0
- tooluniverse/enrichr_tool.py +14 -14
- tooluniverse/ensembl_tool.py +140 -47
- tooluniverse/execute_function.py +594 -29
- tooluniverse/extended_hooks.py +4 -4
- tooluniverse/file_download_tool.py +269 -0
- tooluniverse/gene_ontology_tool.py +1 -1
- tooluniverse/generate_tools.py +3 -3
- tooluniverse/geo_tool.py +81 -28
- tooluniverse/gnomad_tool.py +100 -52
- tooluniverse/gtopdb_tool.py +41 -0
- tooluniverse/humanbase_tool.py +10 -10
- tooluniverse/interpro_tool.py +72 -0
- tooluniverse/jaspar_tool.py +30 -0
- tooluniverse/kegg_tool.py +230 -0
- tooluniverse/logging_config.py +2 -2
- tooluniverse/mcp_client_tool.py +57 -129
- tooluniverse/mcp_integration.py +52 -49
- tooluniverse/mcp_tool_registry.py +147 -528
- tooluniverse/mpd_tool.py +42 -0
- tooluniverse/ncbi_eutils_tool.py +96 -0
- tooluniverse/ols_tool.py +435 -0
- tooluniverse/openalex_tool.py +8 -8
- tooluniverse/openfda_tool.py +2 -2
- tooluniverse/output_hook.py +15 -15
- tooluniverse/package_discovery_tool.py +217 -0
- tooluniverse/package_tool.py +1 -1
- tooluniverse/paleobiology_tool.py +30 -0
- tooluniverse/pmc_tool.py +2 -2
- tooluniverse/pride_tool.py +30 -0
- tooluniverse/pypi_package_inspector_tool.py +593 -0
- tooluniverse/python_executor_tool.py +711 -0
- tooluniverse/regulomedb_tool.py +30 -0
- tooluniverse/remap_tool.py +44 -0
- tooluniverse/remote/boltz/boltz_mcp_server.py +1 -1
- tooluniverse/remote/depmap_24q2/depmap_24q2_mcp_tool.py +3 -3
- tooluniverse/remote/immune_compass/compass_tool.py +3 -3
- tooluniverse/remote/pinnacle/pinnacle_tool.py +2 -2
- tooluniverse/remote/transcriptformer/transcriptformer_tool.py +3 -3
- tooluniverse/remote/uspto_downloader/uspto_downloader_mcp_server.py +3 -3
- tooluniverse/remote_tool.py +4 -4
- tooluniverse/screen_tool.py +44 -0
- tooluniverse/scripts/filter_tool_files.py +2 -2
- tooluniverse/smcp.py +93 -12
- tooluniverse/smcp_server.py +100 -21
- tooluniverse/space/__init__.py +46 -0
- tooluniverse/space/loader.py +133 -0
- tooluniverse/space/validator.py +353 -0
- tooluniverse/tool_finder_embedding.py +5 -3
- tooluniverse/tool_finder_keyword.py +12 -10
- tooluniverse/tool_finder_llm.py +12 -8
- tooluniverse/tools/{UCSC_get_genes_by_region.py → BLAST_nucleotide_search.py} +22 -26
- tooluniverse/tools/BLAST_protein_search.py +63 -0
- tooluniverse/tools/ClinVar_search_variants.py +26 -15
- tooluniverse/tools/CodeQualityAnalyzer.py +3 -3
- tooluniverse/tools/EMDB_get_structure.py +46 -0
- tooluniverse/tools/GtoPdb_get_targets.py +52 -0
- tooluniverse/tools/InterPro_get_domain_details.py +46 -0
- tooluniverse/tools/InterPro_get_protein_domains.py +49 -0
- tooluniverse/tools/InterPro_search_domains.py +52 -0
- tooluniverse/tools/JASPAR_get_transcription_factors.py +52 -0
- tooluniverse/tools/MPD_get_phenotype_data.py +59 -0
- tooluniverse/tools/PRIDE_search_proteomics.py +52 -0
- tooluniverse/tools/PackageAnalyzer.py +55 -0
- tooluniverse/tools/Paleobiology_get_fossils.py +52 -0
- tooluniverse/tools/PyPIPackageInspector.py +59 -0
- tooluniverse/tools/ReMap_get_transcription_factor_binding.py +59 -0
- tooluniverse/tools/ReferenceInfoAnalyzer.py +55 -0
- tooluniverse/tools/RegulomeDB_query_variant.py +46 -0
- tooluniverse/tools/SCREEN_get_regulatory_elements.py +59 -0
- tooluniverse/tools/{ArgumentDescriptionOptimizer.py → TestResultsAnalyzer.py} +13 -13
- tooluniverse/tools/ToolDiscover.py +11 -11
- tooluniverse/tools/UniProt_id_mapping.py +63 -0
- tooluniverse/tools/UniProt_search.py +63 -0
- tooluniverse/tools/UnifiedToolGenerator.py +59 -0
- tooluniverse/tools/WoRMS_search_species.py +49 -0
- tooluniverse/tools/XMLToolOptimizer.py +55 -0
- tooluniverse/tools/__init__.py +119 -29
- tooluniverse/tools/_shared_client.py +3 -3
- tooluniverse/tools/alphafold_get_annotations.py +3 -3
- tooluniverse/tools/alphafold_get_prediction.py +3 -3
- tooluniverse/tools/alphafold_get_summary.py +3 -3
- tooluniverse/tools/cBioPortal_get_cancer_studies.py +46 -0
- tooluniverse/tools/cBioPortal_get_mutations.py +52 -0
- tooluniverse/tools/{gnomAD_query_variant.py → clinvar_get_clinical_significance.py} +8 -11
- tooluniverse/tools/clinvar_get_variant_details.py +49 -0
- tooluniverse/tools/dbSNP_get_variant_by_rsid.py +7 -7
- tooluniverse/tools/dbsnp_get_frequencies.py +46 -0
- tooluniverse/tools/dbsnp_search_by_gene.py +52 -0
- tooluniverse/tools/download_binary_file.py +66 -0
- tooluniverse/tools/download_file.py +71 -0
- tooluniverse/tools/download_text_content.py +55 -0
- tooluniverse/tools/dynamic_package_discovery.py +59 -0
- tooluniverse/tools/ensembl_get_sequence.py +52 -0
- tooluniverse/tools/{Ensembl_lookup_gene_by_symbol.py → ensembl_get_variants.py} +11 -11
- tooluniverse/tools/ensembl_lookup_gene.py +46 -0
- tooluniverse/tools/geo_get_dataset_info.py +46 -0
- tooluniverse/tools/geo_get_sample_info.py +46 -0
- tooluniverse/tools/geo_search_datasets.py +67 -0
- tooluniverse/tools/gnomad_get_gene_constraints.py +49 -0
- tooluniverse/tools/kegg_find_genes.py +52 -0
- tooluniverse/tools/kegg_get_gene_info.py +46 -0
- tooluniverse/tools/kegg_get_pathway_info.py +46 -0
- tooluniverse/tools/kegg_list_organisms.py +44 -0
- tooluniverse/tools/kegg_search_pathway.py +46 -0
- tooluniverse/tools/ols_find_similar_terms.py +63 -0
- tooluniverse/tools/{get_hyperopt_info.py → ols_get_ontology_info.py} +13 -10
- tooluniverse/tools/ols_get_term_ancestors.py +67 -0
- tooluniverse/tools/ols_get_term_children.py +67 -0
- tooluniverse/tools/{TestCaseGenerator.py → ols_get_term_info.py} +12 -9
- tooluniverse/tools/{CodeOptimizer.py → ols_search_ontologies.py} +22 -14
- tooluniverse/tools/ols_search_terms.py +71 -0
- tooluniverse/tools/python_code_executor.py +79 -0
- tooluniverse/tools/python_script_runner.py +79 -0
- tooluniverse/tools/web_api_documentation_search.py +63 -0
- tooluniverse/tools/web_search.py +71 -0
- tooluniverse/uniprot_tool.py +219 -16
- tooluniverse/url_tool.py +19 -1
- tooluniverse/uspto_tool.py +1 -1
- tooluniverse/utils.py +12 -12
- tooluniverse/web_search_tool.py +229 -0
- tooluniverse/worms_tool.py +64 -0
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/METADATA +8 -3
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/RECORD +184 -92
- tooluniverse/data/genomics_tools.json +0 -174
- tooluniverse/tools/ToolDescriptionOptimizer.py +0 -67
- tooluniverse/tools/ToolImplementationGenerator.py +0 -67
- tooluniverse/tools/ToolOptimizer.py +0 -59
- tooluniverse/tools/ToolSpecificationGenerator.py +0 -67
- tooluniverse/tools/ToolSpecificationOptimizer.py +0 -63
- tooluniverse/ucsc_tool.py +0 -60
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/WHEEL +0 -0
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/entry_points.txt +0 -0
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/licenses/LICENSE +0 -0
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/top_level.txt +0 -0
tooluniverse/ensembl_tool.py
CHANGED
|
@@ -1,61 +1,154 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Ensembl REST API Tool
|
|
3
|
+
|
|
4
|
+
This tool provides access to the Ensembl genome browser database for gene
|
|
5
|
+
lookup, sequence retrieval, variant information, and homology data.
|
|
6
|
+
"""
|
|
7
|
+
|
|
1
8
|
import requests
|
|
9
|
+
from typing import Dict, Any, Optional
|
|
2
10
|
from .base_tool import BaseTool
|
|
3
11
|
from .tool_registry import register_tool
|
|
4
12
|
|
|
5
13
|
|
|
6
|
-
|
|
7
|
-
class
|
|
8
|
-
"""
|
|
9
|
-
Local tool wrapper for Ensembl REST API lookups.
|
|
10
|
-
Supports symbol→gene lookup (xrefs/symbol) then lookup/id to
|
|
11
|
-
fetch metadata.
|
|
12
|
-
"""
|
|
14
|
+
class EnsemblRESTTool(BaseTool):
|
|
15
|
+
"""Base class for Ensembl REST API tools."""
|
|
13
16
|
|
|
14
17
|
def __init__(self, tool_config):
|
|
15
18
|
super().__init__(tool_config)
|
|
16
|
-
self.
|
|
19
|
+
self.base_url = "https://rest.ensembl.org"
|
|
17
20
|
self.session = requests.Session()
|
|
18
21
|
self.session.headers.update(
|
|
19
|
-
{
|
|
22
|
+
{
|
|
23
|
+
"Accept": "application/json",
|
|
24
|
+
"Content-Type": "application/json",
|
|
25
|
+
"User-Agent": "ToolUniverse/1.0",
|
|
26
|
+
}
|
|
20
27
|
)
|
|
28
|
+
self.timeout = 30
|
|
29
|
+
|
|
30
|
+
def _make_request(
|
|
31
|
+
self, endpoint: str, params: Optional[Dict] = None
|
|
32
|
+
) -> Dict[str, Any]:
|
|
33
|
+
"""Make a request to the Ensembl API."""
|
|
34
|
+
url = f"{self.base_url}{endpoint}"
|
|
35
|
+
try:
|
|
36
|
+
response = self.session.get(url, params=params, timeout=self.timeout)
|
|
37
|
+
response.raise_for_status()
|
|
38
|
+
|
|
39
|
+
data = response.json()
|
|
40
|
+
return {
|
|
41
|
+
"status": "success",
|
|
42
|
+
"data": data,
|
|
43
|
+
"url": url,
|
|
44
|
+
"content_type": response.headers.get(
|
|
45
|
+
"content-type", "application/json"
|
|
46
|
+
),
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
except requests.exceptions.RequestException as e:
|
|
50
|
+
return {
|
|
51
|
+
"status": "error",
|
|
52
|
+
"error": f"Ensembl API request failed: {str(e)}",
|
|
53
|
+
"url": url,
|
|
54
|
+
}
|
|
21
55
|
|
|
22
|
-
def run(self, arguments):
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if not gene_id and xrefs:
|
|
39
|
-
gene_id = xrefs[0].get("id")
|
|
56
|
+
def run(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
|
57
|
+
"""Execute the tool with given arguments."""
|
|
58
|
+
return self._make_request(self.endpoint, arguments)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@register_tool("EnsemblLookupGene")
|
|
62
|
+
class EnsemblLookupGene(EnsemblRESTTool):
|
|
63
|
+
"""Lookup gene information by ID or symbol."""
|
|
64
|
+
|
|
65
|
+
def __init__(self, tool_config):
|
|
66
|
+
super().__init__(tool_config)
|
|
67
|
+
self.endpoint = "/lookup/id"
|
|
68
|
+
|
|
69
|
+
def run(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
|
70
|
+
"""Lookup gene by ID or symbol."""
|
|
71
|
+
gene_id = arguments.get("gene_id", "")
|
|
40
72
|
if not gene_id:
|
|
41
|
-
return {"
|
|
42
|
-
|
|
43
|
-
#
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
return {"status": "error", "error": "gene_id is required"}
|
|
74
|
+
|
|
75
|
+
# Ensembl API requires the ID in the URL path
|
|
76
|
+
endpoint = f"{self.endpoint}/{gene_id}"
|
|
77
|
+
params = {"expand": 1}
|
|
78
|
+
|
|
79
|
+
# Add species if specified
|
|
80
|
+
if "species" in arguments:
|
|
81
|
+
params["species"] = arguments["species"]
|
|
82
|
+
|
|
83
|
+
result = self._make_request(endpoint, params)
|
|
84
|
+
|
|
85
|
+
# Add gene_id to result for reference
|
|
86
|
+
if result.get("status") == "success":
|
|
87
|
+
result["gene_id"] = gene_id
|
|
88
|
+
|
|
89
|
+
return result
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@register_tool("EnsemblGetSequence")
|
|
93
|
+
class EnsemblGetSequence(EnsemblRESTTool):
|
|
94
|
+
"""Get DNA or protein sequences by region or gene ID."""
|
|
95
|
+
|
|
96
|
+
def __init__(self, tool_config):
|
|
97
|
+
super().__init__(tool_config)
|
|
98
|
+
self.endpoint = "/sequence/id"
|
|
99
|
+
|
|
100
|
+
def run(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
|
101
|
+
"""Get sequence by gene ID or region."""
|
|
102
|
+
sequence_id = arguments.get("sequence_id", "")
|
|
103
|
+
if not sequence_id:
|
|
104
|
+
return {"status": "error", "error": "sequence_id is required"}
|
|
105
|
+
|
|
106
|
+
# Ensembl API requires the ID in the URL path
|
|
107
|
+
endpoint = f"{self.endpoint}/{sequence_id}"
|
|
108
|
+
params = {
|
|
109
|
+
"type": arguments.get("type", "genomic"), # genomic, cds, protein
|
|
110
|
+
"multiple_sequences": "true",
|
|
61
111
|
}
|
|
112
|
+
|
|
113
|
+
# Add species if specified
|
|
114
|
+
if "species" in arguments:
|
|
115
|
+
params["species"] = arguments["species"]
|
|
116
|
+
|
|
117
|
+
result = self._make_request(endpoint, params)
|
|
118
|
+
|
|
119
|
+
# Add sequence_id to result for reference
|
|
120
|
+
if result.get("status") == "success":
|
|
121
|
+
result["sequence_id"] = sequence_id
|
|
122
|
+
|
|
123
|
+
return result
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
@register_tool("EnsemblGetVariants")
|
|
127
|
+
class EnsemblGetVariants(EnsemblRESTTool):
|
|
128
|
+
"""Get variant information for a genomic region."""
|
|
129
|
+
|
|
130
|
+
def __init__(self, tool_config):
|
|
131
|
+
super().__init__(tool_config)
|
|
132
|
+
self.endpoint = "/overlap/id"
|
|
133
|
+
|
|
134
|
+
def run(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
|
135
|
+
"""Get variants for a region."""
|
|
136
|
+
region = arguments.get("region", "")
|
|
137
|
+
if not region:
|
|
138
|
+
return {
|
|
139
|
+
"status": "error",
|
|
140
|
+
"error": "region is required (e.g., '1:1000000..2000000')",
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
# Ensembl API requires the region in the URL path with species
|
|
144
|
+
species = arguments.get("species", "human")
|
|
145
|
+
endpoint = f"/overlap/region/{species}/{region}"
|
|
146
|
+
params = {"feature": "variation", "content-type": "application/json"}
|
|
147
|
+
|
|
148
|
+
result = self._make_request(endpoint, params)
|
|
149
|
+
|
|
150
|
+
# Add region to result for reference
|
|
151
|
+
if result.get("status") == "success":
|
|
152
|
+
result["region"] = region
|
|
153
|
+
|
|
154
|
+
return result
|