tooluniverse 1.0.7__py3-none-any.whl → 1.0.9__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.

Files changed (96) hide show
  1. tooluniverse/__init__.py +37 -14
  2. tooluniverse/admetai_tool.py +16 -5
  3. tooluniverse/base_tool.py +36 -0
  4. tooluniverse/biogrid_tool.py +118 -0
  5. tooluniverse/build_optimizer.py +87 -0
  6. tooluniverse/cache/__init__.py +3 -0
  7. tooluniverse/cache/memory_cache.py +99 -0
  8. tooluniverse/cache/result_cache_manager.py +235 -0
  9. tooluniverse/cache/sqlite_backend.py +257 -0
  10. tooluniverse/clinvar_tool.py +90 -0
  11. tooluniverse/compose_scripts/output_summarizer.py +87 -33
  12. tooluniverse/compose_tool.py +2 -2
  13. tooluniverse/custom_tool.py +28 -0
  14. tooluniverse/data/adverse_event_tools.json +97 -98
  15. tooluniverse/data/agentic_tools.json +81 -162
  16. tooluniverse/data/arxiv_tools.json +1 -4
  17. tooluniverse/data/compose_tools.json +0 -54
  18. tooluniverse/data/core_tools.json +1 -4
  19. tooluniverse/data/dataset_tools.json +7 -7
  20. tooluniverse/data/doaj_tools.json +1 -3
  21. tooluniverse/data/drug_discovery_agents.json +282 -0
  22. tooluniverse/data/europe_pmc_tools.json +1 -2
  23. tooluniverse/data/genomics_tools.json +174 -0
  24. tooluniverse/data/geo_tools.json +86 -0
  25. tooluniverse/data/literature_search_tools.json +15 -35
  26. tooluniverse/data/markitdown_tools.json +51 -0
  27. tooluniverse/data/monarch_tools.json +1 -2
  28. tooluniverse/data/openalex_tools.json +1 -5
  29. tooluniverse/data/opentarget_tools.json +8 -16
  30. tooluniverse/data/output_summarization_tools.json +23 -20
  31. tooluniverse/data/packages/bioinformatics_core_tools.json +2 -2
  32. tooluniverse/data/packages/cheminformatics_tools.json +1 -1
  33. tooluniverse/data/packages/genomics_tools.json +1 -1
  34. tooluniverse/data/packages/single_cell_tools.json +1 -1
  35. tooluniverse/data/packages/structural_biology_tools.json +1 -1
  36. tooluniverse/data/pmc_tools.json +1 -4
  37. tooluniverse/data/ppi_tools.json +139 -0
  38. tooluniverse/data/pubmed_tools.json +1 -3
  39. tooluniverse/data/semantic_scholar_tools.json +1 -2
  40. tooluniverse/data/tool_composition_tools.json +2 -4
  41. tooluniverse/data/unified_guideline_tools.json +206 -4
  42. tooluniverse/data/xml_tools.json +15 -15
  43. tooluniverse/data/zenodo_tools.json +1 -2
  44. tooluniverse/dbsnp_tool.py +71 -0
  45. tooluniverse/default_config.py +6 -0
  46. tooluniverse/ensembl_tool.py +61 -0
  47. tooluniverse/execute_function.py +235 -76
  48. tooluniverse/generate_tools.py +303 -20
  49. tooluniverse/genomics_gene_search_tool.py +56 -0
  50. tooluniverse/geo_tool.py +116 -0
  51. tooluniverse/gnomad_tool.py +63 -0
  52. tooluniverse/logging_config.py +64 -2
  53. tooluniverse/markitdown_tool.py +159 -0
  54. tooluniverse/mcp_client_tool.py +10 -5
  55. tooluniverse/molecule_2d_tool.py +9 -3
  56. tooluniverse/molecule_3d_tool.py +9 -3
  57. tooluniverse/output_hook.py +217 -150
  58. tooluniverse/smcp.py +18 -10
  59. tooluniverse/smcp_server.py +89 -199
  60. tooluniverse/string_tool.py +112 -0
  61. tooluniverse/tools/{MultiAgentLiteratureSearch.py → ADMETAnalyzerAgent.py} +18 -18
  62. tooluniverse/tools/ArXiv_search_papers.py +3 -3
  63. tooluniverse/tools/CMA_Guidelines_Search.py +52 -0
  64. tooluniverse/tools/CORE_search_papers.py +3 -3
  65. tooluniverse/tools/ClinVar_search_variants.py +52 -0
  66. tooluniverse/tools/ClinicalTrialDesignAgent.py +63 -0
  67. tooluniverse/tools/CompoundDiscoveryAgent.py +59 -0
  68. tooluniverse/tools/DOAJ_search_articles.py +2 -2
  69. tooluniverse/tools/DiseaseAnalyzerAgent.py +52 -0
  70. tooluniverse/tools/DrugInteractionAnalyzerAgent.py +52 -0
  71. tooluniverse/tools/DrugOptimizationAgent.py +63 -0
  72. tooluniverse/tools/Ensembl_lookup_gene_by_symbol.py +52 -0
  73. tooluniverse/tools/EuropePMC_search_articles.py +1 -1
  74. tooluniverse/tools/GIN_Guidelines_Search.py +52 -0
  75. tooluniverse/tools/GWAS_search_associations_by_gene.py +52 -0
  76. tooluniverse/tools/LiteratureSynthesisAgent.py +59 -0
  77. tooluniverse/tools/PMC_search_papers.py +3 -3
  78. tooluniverse/tools/PubMed_search_articles.py +2 -2
  79. tooluniverse/tools/SemanticScholar_search_papers.py +1 -1
  80. tooluniverse/tools/UCSC_get_genes_by_region.py +67 -0
  81. tooluniverse/tools/Zenodo_search_records.py +1 -1
  82. tooluniverse/tools/__init__.py +33 -3
  83. tooluniverse/tools/convert_to_markdown.py +59 -0
  84. tooluniverse/tools/dbSNP_get_variant_by_rsid.py +46 -0
  85. tooluniverse/tools/gnomAD_query_variant.py +52 -0
  86. tooluniverse/tools/openalex_literature_search.py +4 -4
  87. tooluniverse/ucsc_tool.py +60 -0
  88. tooluniverse/unified_guideline_tools.py +1175 -57
  89. tooluniverse/utils.py +51 -4
  90. tooluniverse/zenodo_tool.py +2 -1
  91. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.9.dist-info}/METADATA +10 -3
  92. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.9.dist-info}/RECORD +96 -61
  93. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.9.dist-info}/entry_points.txt +0 -3
  94. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.9.dist-info}/WHEEL +0 -0
  95. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.9.dist-info}/licenses/LICENSE +0 -0
  96. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.9.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  """
2
2
  ToolUniverse Tools
3
3
 
4
- Type-safe Python interface to 654 scientific tools.
4
+ Type-safe Python interface to 669 scientific tools.
5
5
  Each tool is in its own module for minimal import overhead.
6
6
 
7
7
  Usage:
@@ -32,6 +32,7 @@ from .ADMETAI_predict_solubility_lipophilicity_hydration import (
32
32
  )
33
33
  from .ADMETAI_predict_stress_response import ADMETAI_predict_stress_response
34
34
  from .ADMETAI_predict_toxicity import ADMETAI_predict_toxicity
35
+ from .ADMETAnalyzerAgent import ADMETAnalyzerAgent
35
36
  from .AdvancedCodeQualityAnalyzer import AdvancedCodeQualityAnalyzer
36
37
  from .AdverseEventICDMapper import AdverseEventICDMapper
37
38
  from .AdverseEventPredictionQuestionGenerator import (
@@ -44,11 +45,15 @@ from .ArXiv_search_papers import ArXiv_search_papers
44
45
  from .ArgumentDescriptionOptimizer import ArgumentDescriptionOptimizer
45
46
  from .BioRxiv_search_preprints import BioRxiv_search_preprints
46
47
  from .BiomarkerDiscoveryWorkflow import BiomarkerDiscoveryWorkflow
48
+ from .CMA_Guidelines_Search import CMA_Guidelines_Search
47
49
  from .CORE_search_papers import CORE_search_papers
48
50
  from .CallAgent import CallAgent
49
51
  from .ChEMBL_search_similar_molecules import ChEMBL_search_similar_molecules
52
+ from .ClinVar_search_variants import ClinVar_search_variants
53
+ from .ClinicalTrialDesignAgent import ClinicalTrialDesignAgent
50
54
  from .CodeOptimizer import CodeOptimizer
51
55
  from .CodeQualityAnalyzer import CodeQualityAnalyzer
56
+ from .CompoundDiscoveryAgent import CompoundDiscoveryAgent
52
57
  from .ComprehensiveDrugDiscoveryPipeline import ComprehensiveDrugDiscoveryPipeline
53
58
  from .Crossref_search_works import Crossref_search_works
54
59
  from .DBLP_search_publications import DBLP_search_publications
@@ -58,8 +63,12 @@ from .DailyMed_search_spls import DailyMed_search_spls
58
63
  from .DataAnalysisValidityReviewer import DataAnalysisValidityReviewer
59
64
  from .DescriptionAnalyzer import DescriptionAnalyzer
60
65
  from .DescriptionQualityEvaluator import DescriptionQualityEvaluator
66
+ from .DiseaseAnalyzerAgent import DiseaseAnalyzerAgent
61
67
  from .DomainExpertValidator import DomainExpertValidator
68
+ from .DrugInteractionAnalyzerAgent import DrugInteractionAnalyzerAgent
69
+ from .DrugOptimizationAgent import DrugOptimizationAgent
62
70
  from .DrugSafetyAnalyzer import DrugSafetyAnalyzer
71
+ from .Ensembl_lookup_gene_by_symbol import Ensembl_lookup_gene_by_symbol
63
72
  from .EthicalComplianceReviewer import EthicalComplianceReviewer
64
73
  from .EuropePMC_Guidelines_Search import EuropePMC_Guidelines_Search
65
74
  from .EuropePMC_search_articles import EuropePMC_search_articles
@@ -441,11 +450,13 @@ from .FDA_retrieve_patient_medication_info_by_drug_name import (
441
450
  )
442
451
  from .Fatcat_search_scholar import Fatcat_search_scholar
443
452
  from .Finish import Finish
453
+ from .GIN_Guidelines_Search import GIN_Guidelines_Search
444
454
  from .GO_get_annotations_for_gene import GO_get_annotations_for_gene
445
455
  from .GO_get_genes_for_term import GO_get_genes_for_term
446
456
  from .GO_get_term_by_id import GO_get_term_by_id
447
457
  from .GO_get_term_details import GO_get_term_details
448
458
  from .GO_search_terms import GO_search_terms
459
+ from .GWAS_search_associations_by_gene import GWAS_search_associations_by_gene
449
460
  from .HAL_search_archive import HAL_search_archive
450
461
  from .HPA_get_biological_processes_by_gene import HPA_get_biological_processes_by_gene
451
462
  from .HPA_get_cancer_prognostics_by_gene import HPA_get_cancer_prognostics_by_gene
@@ -474,6 +485,7 @@ from .HypothesisGenerator import HypothesisGenerator
474
485
  from .LabelGenerator import LabelGenerator
475
486
  from .LiteratureContextReviewer import LiteratureContextReviewer
476
487
  from .LiteratureSearchTool import LiteratureSearchTool
488
+ from .LiteratureSynthesisAgent import LiteratureSynthesisAgent
477
489
  from .MedRxiv_search_preprints import MedRxiv_search_preprints
478
490
  from .MedicalLiteratureReviewer import MedicalLiteratureReviewer
479
491
  from .MedicalTermNormalizer import MedicalTermNormalizer
@@ -485,7 +497,6 @@ from .MedlinePlus_get_genetics_gene_by_name import MedlinePlus_get_genetics_gene
485
497
  from .MedlinePlus_get_genetics_index import MedlinePlus_get_genetics_index
486
498
  from .MedlinePlus_search_topics_by_keyword import MedlinePlus_search_topics_by_keyword
487
499
  from .MethodologyRigorReviewer import MethodologyRigorReviewer
488
- from .MultiAgentLiteratureSearch import MultiAgentLiteratureSearch
489
500
  from .NICE_Clinical_Guidelines_Search import NICE_Clinical_Guidelines_Search
490
501
  from .NICE_Guideline_Full_Text import NICE_Guideline_Full_Text
491
502
  from .NoveltySignificanceReviewer import NoveltySignificanceReviewer
@@ -704,6 +715,7 @@ from .Tool_Finder import Tool_Finder
704
715
  from .Tool_Finder_Keyword import Tool_Finder_Keyword
705
716
  from .Tool_Finder_LLM import Tool_Finder_LLM
706
717
  from .Tool_RAG import Tool_RAG
718
+ from .UCSC_get_genes_by_region import UCSC_get_genes_by_region
707
719
  from .UniProt_get_alternative_names_by_accession import (
708
720
  UniProt_get_alternative_names_by_accession,
709
721
  )
@@ -744,6 +756,8 @@ from .cellosaurus_get_cell_line_info import cellosaurus_get_cell_line_info
744
756
  from .cellosaurus_query_converter import cellosaurus_query_converter
745
757
  from .cellosaurus_search_cell_lines import cellosaurus_search_cell_lines
746
758
  from .chembl_disease_target_score import chembl_disease_target_score
759
+ from .convert_to_markdown import convert_to_markdown
760
+ from .dbSNP_get_variant_by_rsid import dbSNP_get_variant_by_rsid
747
761
  from .dict_search import dict_search
748
762
  from .dili_search import dili_search
749
763
  from .diqt_search import diqt_search
@@ -1046,6 +1060,7 @@ from .get_xarray_info import get_xarray_info
1046
1060
  from .get_xesmf_info import get_xesmf_info
1047
1061
  from .get_xgboost_info import get_xgboost_info
1048
1062
  from .get_zarr_info import get_zarr_info
1063
+ from .gnomAD_query_variant import gnomAD_query_variant
1049
1064
  from .gwas_get_association_by_id import gwas_get_association_by_id
1050
1065
  from .gwas_get_associations_for_snp import gwas_get_associations_for_snp
1051
1066
  from .gwas_get_associations_for_study import gwas_get_associations_for_study
@@ -1090,6 +1105,7 @@ __all__ = [
1090
1105
  "ADMETAI_predict_solubility_lipophilicity_hydration",
1091
1106
  "ADMETAI_predict_stress_response",
1092
1107
  "ADMETAI_predict_toxicity",
1108
+ "ADMETAnalyzerAgent",
1093
1109
  "AdvancedCodeQualityAnalyzer",
1094
1110
  "AdverseEventICDMapper",
1095
1111
  "AdverseEventPredictionQuestionGenerator",
@@ -1098,11 +1114,15 @@ __all__ = [
1098
1114
  "ArgumentDescriptionOptimizer",
1099
1115
  "BioRxiv_search_preprints",
1100
1116
  "BiomarkerDiscoveryWorkflow",
1117
+ "CMA_Guidelines_Search",
1101
1118
  "CORE_search_papers",
1102
1119
  "CallAgent",
1103
1120
  "ChEMBL_search_similar_molecules",
1121
+ "ClinVar_search_variants",
1122
+ "ClinicalTrialDesignAgent",
1104
1123
  "CodeOptimizer",
1105
1124
  "CodeQualityAnalyzer",
1125
+ "CompoundDiscoveryAgent",
1106
1126
  "ComprehensiveDrugDiscoveryPipeline",
1107
1127
  "Crossref_search_works",
1108
1128
  "DBLP_search_publications",
@@ -1112,8 +1132,12 @@ __all__ = [
1112
1132
  "DataAnalysisValidityReviewer",
1113
1133
  "DescriptionAnalyzer",
1114
1134
  "DescriptionQualityEvaluator",
1135
+ "DiseaseAnalyzerAgent",
1115
1136
  "DomainExpertValidator",
1137
+ "DrugInteractionAnalyzerAgent",
1138
+ "DrugOptimizationAgent",
1116
1139
  "DrugSafetyAnalyzer",
1140
+ "Ensembl_lookup_gene_by_symbol",
1117
1141
  "EthicalComplianceReviewer",
1118
1142
  "EuropePMC_Guidelines_Search",
1119
1143
  "EuropePMC_search_articles",
@@ -1291,11 +1315,13 @@ __all__ = [
1291
1315
  "FDA_retrieve_patient_medication_info_by_drug_name",
1292
1316
  "Fatcat_search_scholar",
1293
1317
  "Finish",
1318
+ "GIN_Guidelines_Search",
1294
1319
  "GO_get_annotations_for_gene",
1295
1320
  "GO_get_genes_for_term",
1296
1321
  "GO_get_term_by_id",
1297
1322
  "GO_get_term_details",
1298
1323
  "GO_search_terms",
1324
+ "GWAS_search_associations_by_gene",
1299
1325
  "HAL_search_archive",
1300
1326
  "HPA_get_biological_processes_by_gene",
1301
1327
  "HPA_get_cancer_prognostics_by_gene",
@@ -1314,6 +1340,7 @@ __all__ = [
1314
1340
  "LabelGenerator",
1315
1341
  "LiteratureContextReviewer",
1316
1342
  "LiteratureSearchTool",
1343
+ "LiteratureSynthesisAgent",
1317
1344
  "MedRxiv_search_preprints",
1318
1345
  "MedicalLiteratureReviewer",
1319
1346
  "MedicalTermNormalizer",
@@ -1323,7 +1350,6 @@ __all__ = [
1323
1350
  "MedlinePlus_get_genetics_index",
1324
1351
  "MedlinePlus_search_topics_by_keyword",
1325
1352
  "MethodologyRigorReviewer",
1326
- "MultiAgentLiteratureSearch",
1327
1353
  "NICE_Clinical_Guidelines_Search",
1328
1354
  "NICE_Guideline_Full_Text",
1329
1355
  "NoveltySignificanceReviewer",
@@ -1430,6 +1456,7 @@ __all__ = [
1430
1456
  "Tool_Finder_Keyword",
1431
1457
  "Tool_Finder_LLM",
1432
1458
  "Tool_RAG",
1459
+ "UCSC_get_genes_by_region",
1433
1460
  "UniProt_get_alternative_names_by_accession",
1434
1461
  "UniProt_get_disease_variants_by_accession",
1435
1462
  "UniProt_get_entry_by_accession",
@@ -1456,6 +1483,8 @@ __all__ = [
1456
1483
  "cellosaurus_query_converter",
1457
1484
  "cellosaurus_search_cell_lines",
1458
1485
  "chembl_disease_target_score",
1486
+ "convert_to_markdown",
1487
+ "dbSNP_get_variant_by_rsid",
1459
1488
  "dict_search",
1460
1489
  "dili_search",
1461
1490
  "diqt_search",
@@ -1708,6 +1737,7 @@ __all__ = [
1708
1737
  "get_xesmf_info",
1709
1738
  "get_xgboost_info",
1710
1739
  "get_zarr_info",
1740
+ "gnomAD_query_variant",
1711
1741
  "gwas_get_association_by_id",
1712
1742
  "gwas_get_associations_for_snp",
1713
1743
  "gwas_get_associations_for_study",
@@ -0,0 +1,59 @@
1
+ """
2
+ convert_to_markdown
3
+
4
+ Convert a resource described by an http:, https:, file: or data: URI to markdown.
5
+ """
6
+
7
+ from typing import Any, Optional, Callable
8
+ from ._shared_client import get_shared_client
9
+
10
+
11
+ def convert_to_markdown(
12
+ uri: str,
13
+ output_path: Optional[str] = None,
14
+ enable_plugins: Optional[bool] = False,
15
+ *,
16
+ stream_callback: Optional[Callable[[str], None]] = None,
17
+ use_cache: bool = False,
18
+ validate: bool = True,
19
+ ) -> dict[str, Any]:
20
+ """
21
+ Convert a resource described by an http:, https:, file: or data: URI to markdown.
22
+
23
+ Parameters
24
+ ----------
25
+ uri : str
26
+ URI of the resource to convert (supports http:, https:, file:, data: URIs)
27
+ output_path : str
28
+ Optional output file path
29
+ enable_plugins : bool
30
+ Enable 3rd-party plugins
31
+ stream_callback : Callable, optional
32
+ Callback for streaming output
33
+ use_cache : bool, default False
34
+ Enable caching
35
+ validate : bool, default True
36
+ Validate parameters
37
+
38
+ Returns
39
+ -------
40
+ dict[str, Any]
41
+ """
42
+ # Handle mutable defaults to avoid B006 linting error
43
+
44
+ return get_shared_client().run_one_function(
45
+ {
46
+ "name": "convert_to_markdown",
47
+ "arguments": {
48
+ "uri": uri,
49
+ "output_path": output_path,
50
+ "enable_plugins": enable_plugins,
51
+ },
52
+ },
53
+ stream_callback=stream_callback,
54
+ use_cache=use_cache,
55
+ validate=validate,
56
+ )
57
+
58
+
59
+ __all__ = ["convert_to_markdown"]
@@ -0,0 +1,46 @@
1
+ """
2
+ dbSNP_get_variant_by_rsid
3
+
4
+ Fetch dbSNP variant by rsID using NCBI Variation Services (refsnp endpoint).
5
+ """
6
+
7
+ from typing import Any, Optional, Callable
8
+ from ._shared_client import get_shared_client
9
+
10
+
11
+ def dbSNP_get_variant_by_rsid(
12
+ rsid: str,
13
+ *,
14
+ stream_callback: Optional[Callable[[str], None]] = None,
15
+ use_cache: bool = False,
16
+ validate: bool = True,
17
+ ) -> dict[str, Any]:
18
+ """
19
+ Fetch dbSNP variant by rsID using NCBI Variation Services (refsnp endpoint).
20
+
21
+ Parameters
22
+ ----------
23
+ rsid : str
24
+ rsID without 'rs' prefix or with (e.g., rs699 or 699).
25
+ stream_callback : Callable, optional
26
+ Callback for streaming output
27
+ use_cache : bool, default False
28
+ Enable caching
29
+ validate : bool, default True
30
+ Validate parameters
31
+
32
+ Returns
33
+ -------
34
+ dict[str, Any]
35
+ """
36
+ # Handle mutable defaults to avoid B006 linting error
37
+
38
+ return get_shared_client().run_one_function(
39
+ {"name": "dbSNP_get_variant_by_rsid", "arguments": {"rsid": rsid}},
40
+ stream_callback=stream_callback,
41
+ use_cache=use_cache,
42
+ validate=validate,
43
+ )
44
+
45
+
46
+ __all__ = ["dbSNP_get_variant_by_rsid"]
@@ -0,0 +1,52 @@
1
+ """
2
+ gnomAD_query_variant
3
+
4
+ Query gnomAD GraphQL for a variant in a dataset (returns ID and genome allele counts/frequency).
5
+ """
6
+
7
+ from typing import Any, Optional, Callable
8
+ from ._shared_client import get_shared_client
9
+
10
+
11
+ def gnomAD_query_variant(
12
+ variant_id: str,
13
+ dataset: Optional[str] = "gnomad_r4",
14
+ *,
15
+ stream_callback: Optional[Callable[[str], None]] = None,
16
+ use_cache: bool = False,
17
+ validate: bool = True,
18
+ ) -> dict[str, Any]:
19
+ """
20
+ Query gnomAD GraphQL for a variant in a dataset (returns ID and genome allele counts/frequency).
21
+
22
+ Parameters
23
+ ----------
24
+ variant_id : str
25
+ Variant ID like '1-230710048-A-G'.
26
+ dataset : str
27
+ Dataset ID (e.g., gnomad_r4).
28
+ stream_callback : Callable, optional
29
+ Callback for streaming output
30
+ use_cache : bool, default False
31
+ Enable caching
32
+ validate : bool, default True
33
+ Validate parameters
34
+
35
+ Returns
36
+ -------
37
+ dict[str, Any]
38
+ """
39
+ # Handle mutable defaults to avoid B006 linting error
40
+
41
+ return get_shared_client().run_one_function(
42
+ {
43
+ "name": "gnomAD_query_variant",
44
+ "arguments": {"variant_id": variant_id, "dataset": dataset},
45
+ },
46
+ stream_callback=stream_callback,
47
+ use_cache=use_cache,
48
+ validate=validate,
49
+ )
50
+
51
+
52
+ __all__ = ["gnomAD_query_variant"]
@@ -10,10 +10,10 @@ from ._shared_client import get_shared_client
10
10
 
11
11
  def openalex_literature_search(
12
12
  search_keywords: str,
13
- max_results: int,
14
- year_from: int,
15
- year_to: int,
16
- open_access: bool,
13
+ max_results: Optional[int] = 10,
14
+ year_from: Optional[int] = None,
15
+ year_to: Optional[int] = None,
16
+ open_access: Optional[bool] = None,
17
17
  *,
18
18
  stream_callback: Optional[Callable[[str], None]] = None,
19
19
  use_cache: bool = False,
@@ -0,0 +1,60 @@
1
+ import requests
2
+ from .base_tool import BaseTool
3
+ from .tool_registry import register_tool
4
+
5
+
6
+ @register_tool("UCSCTool")
7
+ class UCSCTool(BaseTool):
8
+ """
9
+ Local tool wrapper for UCSC Genome Browser track API.
10
+ Queries knownGene track for genomic regions.
11
+ """
12
+
13
+ def __init__(self, tool_config):
14
+ super().__init__(tool_config)
15
+ self.base = "https://api.genome.ucsc.edu/getData/track"
16
+ self.session = requests.Session()
17
+
18
+ def run(self, arguments):
19
+ genome = arguments.get("genome", "hg38")
20
+ chrom = arguments.get("chrom")
21
+ start = arguments.get("start")
22
+ end = arguments.get("end")
23
+ track = arguments.get("track", "knownGene")
24
+
25
+ if not all([chrom, start is not None, end is not None]):
26
+ return {"error": "Missing required parameters: chrom, start, end"}
27
+
28
+ params = {
29
+ "genome": genome,
30
+ "track": track,
31
+ "chrom": chrom,
32
+ "start": start,
33
+ "end": end,
34
+ }
35
+
36
+ resp = self.session.get(self.base, params=params, timeout=30)
37
+ resp.raise_for_status()
38
+ data = resp.json()
39
+
40
+ features = data.get(track, [])
41
+ items_returned = len(features)
42
+
43
+ # Extract key fields from each feature
44
+ processed_features = []
45
+ for feature in features:
46
+ processed_features.append(
47
+ {
48
+ "name": feature.get("name", ""),
49
+ "geneName": feature.get("geneName", ""),
50
+ "chrom": feature.get("chrom", ""),
51
+ "chromStart": feature.get("chromStart"),
52
+ "chromEnd": feature.get("chromEnd"),
53
+ "strand": feature.get("strand", ""),
54
+ }
55
+ )
56
+
57
+ return {
58
+ "itemsReturned": items_returned,
59
+ "features": processed_features,
60
+ }