tooluniverse 1.0.7__py3-none-any.whl → 1.0.8__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 (76) hide show
  1. tooluniverse/__init__.py +29 -14
  2. tooluniverse/admetai_tool.py +8 -4
  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/custom_tool.py +28 -0
  12. tooluniverse/data/arxiv_tools.json +1 -4
  13. tooluniverse/data/core_tools.json +1 -4
  14. tooluniverse/data/dataset_tools.json +7 -7
  15. tooluniverse/data/doaj_tools.json +1 -3
  16. tooluniverse/data/drug_discovery_agents.json +292 -0
  17. tooluniverse/data/europe_pmc_tools.json +1 -2
  18. tooluniverse/data/genomics_tools.json +174 -0
  19. tooluniverse/data/geo_tools.json +86 -0
  20. tooluniverse/data/markitdown_tools.json +51 -0
  21. tooluniverse/data/openalex_tools.json +1 -5
  22. tooluniverse/data/pmc_tools.json +1 -4
  23. tooluniverse/data/ppi_tools.json +139 -0
  24. tooluniverse/data/pubmed_tools.json +1 -3
  25. tooluniverse/data/semantic_scholar_tools.json +1 -2
  26. tooluniverse/data/unified_guideline_tools.json +206 -4
  27. tooluniverse/data/xml_tools.json +15 -15
  28. tooluniverse/data/zenodo_tools.json +1 -2
  29. tooluniverse/dbsnp_tool.py +71 -0
  30. tooluniverse/default_config.py +6 -0
  31. tooluniverse/ensembl_tool.py +61 -0
  32. tooluniverse/execute_function.py +196 -75
  33. tooluniverse/generate_tools.py +303 -20
  34. tooluniverse/genomics_gene_search_tool.py +56 -0
  35. tooluniverse/geo_tool.py +116 -0
  36. tooluniverse/gnomad_tool.py +63 -0
  37. tooluniverse/markitdown_tool.py +159 -0
  38. tooluniverse/mcp_client_tool.py +10 -5
  39. tooluniverse/smcp.py +10 -9
  40. tooluniverse/string_tool.py +112 -0
  41. tooluniverse/tools/ADMETAnalyzerAgent.py +59 -0
  42. tooluniverse/tools/ArXiv_search_papers.py +3 -3
  43. tooluniverse/tools/CMA_Guidelines_Search.py +52 -0
  44. tooluniverse/tools/CORE_search_papers.py +3 -3
  45. tooluniverse/tools/ClinVar_search_variants.py +52 -0
  46. tooluniverse/tools/ClinicalTrialDesignAgent.py +63 -0
  47. tooluniverse/tools/CompoundDiscoveryAgent.py +59 -0
  48. tooluniverse/tools/DOAJ_search_articles.py +2 -2
  49. tooluniverse/tools/DiseaseAnalyzerAgent.py +52 -0
  50. tooluniverse/tools/DrugInteractionAnalyzerAgent.py +52 -0
  51. tooluniverse/tools/DrugOptimizationAgent.py +63 -0
  52. tooluniverse/tools/Ensembl_lookup_gene_by_symbol.py +52 -0
  53. tooluniverse/tools/EuropePMC_search_articles.py +1 -1
  54. tooluniverse/tools/GIN_Guidelines_Search.py +52 -0
  55. tooluniverse/tools/GWAS_search_associations_by_gene.py +52 -0
  56. tooluniverse/tools/LiteratureSynthesisAgent.py +59 -0
  57. tooluniverse/tools/PMC_search_papers.py +3 -3
  58. tooluniverse/tools/PubMed_search_articles.py +2 -2
  59. tooluniverse/tools/SemanticScholar_search_papers.py +1 -1
  60. tooluniverse/tools/UCSC_get_genes_by_region.py +67 -0
  61. tooluniverse/tools/Zenodo_search_records.py +1 -1
  62. tooluniverse/tools/__init__.py +33 -1
  63. tooluniverse/tools/convert_to_markdown.py +59 -0
  64. tooluniverse/tools/dbSNP_get_variant_by_rsid.py +46 -0
  65. tooluniverse/tools/gnomAD_query_variant.py +52 -0
  66. tooluniverse/tools/openalex_literature_search.py +4 -4
  67. tooluniverse/ucsc_tool.py +60 -0
  68. tooluniverse/unified_guideline_tools.py +1175 -57
  69. tooluniverse/utils.py +51 -4
  70. tooluniverse/zenodo_tool.py +2 -1
  71. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.8.dist-info}/METADATA +9 -3
  72. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.8.dist-info}/RECORD +76 -40
  73. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.8.dist-info}/WHEEL +0 -0
  74. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.8.dist-info}/entry_points.txt +0 -0
  75. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.8.dist-info}/licenses/LICENSE +0 -0
  76. {tooluniverse-1.0.7.dist-info → tooluniverse-1.0.8.dist-info}/top_level.txt +0 -0
@@ -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
+ }