tooluniverse 1.0.4__py3-none-any.whl → 1.0.6__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 (57) hide show
  1. tooluniverse/__init__.py +56 -5
  2. tooluniverse/agentic_tool.py +90 -14
  3. tooluniverse/arxiv_tool.py +113 -0
  4. tooluniverse/biorxiv_tool.py +97 -0
  5. tooluniverse/core_tool.py +153 -0
  6. tooluniverse/crossref_tool.py +73 -0
  7. tooluniverse/data/agentic_tools.json +2 -2
  8. tooluniverse/data/arxiv_tools.json +87 -0
  9. tooluniverse/data/biorxiv_tools.json +70 -0
  10. tooluniverse/data/core_tools.json +105 -0
  11. tooluniverse/data/crossref_tools.json +70 -0
  12. tooluniverse/data/dblp_tools.json +73 -0
  13. tooluniverse/data/doaj_tools.json +94 -0
  14. tooluniverse/data/fatcat_tools.json +72 -0
  15. tooluniverse/data/hal_tools.json +70 -0
  16. tooluniverse/data/medrxiv_tools.json +70 -0
  17. tooluniverse/data/odphp_tools.json +354 -0
  18. tooluniverse/data/openaire_tools.json +85 -0
  19. tooluniverse/data/osf_preprints_tools.json +77 -0
  20. tooluniverse/data/pmc_tools.json +109 -0
  21. tooluniverse/data/pubmed_tools.json +65 -0
  22. tooluniverse/data/unpaywall_tools.json +86 -0
  23. tooluniverse/data/wikidata_sparql_tools.json +42 -0
  24. tooluniverse/data/zenodo_tools.json +82 -0
  25. tooluniverse/dblp_tool.py +62 -0
  26. tooluniverse/default_config.py +18 -0
  27. tooluniverse/doaj_tool.py +124 -0
  28. tooluniverse/execute_function.py +70 -9
  29. tooluniverse/fatcat_tool.py +66 -0
  30. tooluniverse/hal_tool.py +77 -0
  31. tooluniverse/llm_clients.py +487 -0
  32. tooluniverse/mcp_tool_registry.py +3 -3
  33. tooluniverse/medrxiv_tool.py +97 -0
  34. tooluniverse/odphp_tool.py +226 -0
  35. tooluniverse/openaire_tool.py +145 -0
  36. tooluniverse/osf_preprints_tool.py +67 -0
  37. tooluniverse/pmc_tool.py +181 -0
  38. tooluniverse/pubmed_tool.py +110 -0
  39. tooluniverse/remote/boltz/boltz_mcp_server.py +2 -2
  40. tooluniverse/remote/uspto_downloader/uspto_downloader_mcp_server.py +2 -2
  41. tooluniverse/smcp.py +313 -191
  42. tooluniverse/smcp_server.py +4 -7
  43. tooluniverse/test/test_claude_sdk.py +93 -0
  44. tooluniverse/test/test_odphp_tool.py +166 -0
  45. tooluniverse/test/test_openrouter_client.py +288 -0
  46. tooluniverse/test/test_stdio_hooks.py +1 -1
  47. tooluniverse/test/test_tool_finder.py +1 -1
  48. tooluniverse/unpaywall_tool.py +63 -0
  49. tooluniverse/wikidata_sparql_tool.py +61 -0
  50. tooluniverse/zenodo_tool.py +74 -0
  51. {tooluniverse-1.0.4.dist-info → tooluniverse-1.0.6.dist-info}/METADATA +101 -74
  52. {tooluniverse-1.0.4.dist-info → tooluniverse-1.0.6.dist-info}/RECORD +56 -19
  53. {tooluniverse-1.0.4.dist-info → tooluniverse-1.0.6.dist-info}/entry_points.txt +1 -0
  54. tooluniverse-1.0.6.dist-info/licenses/LICENSE +201 -0
  55. tooluniverse-1.0.4.dist-info/licenses/LICENSE +0 -21
  56. {tooluniverse-1.0.4.dist-info → tooluniverse-1.0.6.dist-info}/WHEEL +0 -0
  57. {tooluniverse-1.0.4.dist-info → tooluniverse-1.0.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,110 @@
1
+ import requests
2
+ from .base_tool import BaseTool
3
+ from .tool_registry import register_tool
4
+
5
+
6
+ @register_tool("PubMedTool")
7
+ class PubMedTool(BaseTool):
8
+ """
9
+ Search PubMed using NCBI E-utilities (esearch + esummary) and return
10
+ articles.
11
+ """
12
+
13
+ def __init__(self, tool_config):
14
+ super().__init__(tool_config)
15
+ self.esearch_url = (
16
+ "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi"
17
+ )
18
+ self.esummary_url = (
19
+ "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi"
20
+ )
21
+
22
+ def run(self, arguments):
23
+ query = arguments.get("query")
24
+ limit = int(arguments.get("limit", 10))
25
+ api_key = arguments.get("api_key") # optional NCBI API key
26
+ if not query:
27
+ return {"error": "`query` parameter is required."}
28
+ return self._search(query, limit, api_key)
29
+
30
+ def _search(self, query, limit, api_key=None):
31
+ params = {
32
+ "db": "pubmed",
33
+ "term": query,
34
+ "retmax": max(1, min(limit, 200)),
35
+ "retmode": "json",
36
+ }
37
+ if api_key:
38
+ params["api_key"] = api_key
39
+
40
+ try:
41
+ r = requests.get(self.esearch_url, params=params, timeout=20)
42
+ except requests.RequestException as e:
43
+ return {
44
+ "error": "Network error calling PubMed esearch",
45
+ "reason": str(e),
46
+ }
47
+ if r.status_code != 200:
48
+ return {
49
+ "error": f"PubMed esearch error {r.status_code}",
50
+ "reason": r.reason,
51
+ }
52
+
53
+ data = r.json()
54
+ id_list = data.get("esearchresult", {}).get("idlist", [])
55
+ if not id_list:
56
+ return []
57
+
58
+ summary_params = {
59
+ "db": "pubmed",
60
+ "id": ",".join(id_list),
61
+ "retmode": "json",
62
+ }
63
+ if api_key:
64
+ summary_params["api_key"] = api_key
65
+
66
+ try:
67
+ s = requests.get(
68
+ self.esummary_url,
69
+ params=summary_params,
70
+ timeout=20,
71
+ )
72
+ except requests.RequestException as e:
73
+ return {
74
+ "error": "Network error calling PubMed esummary",
75
+ "reason": str(e),
76
+ }
77
+ if s.status_code != 200:
78
+ return {
79
+ "error": f"PubMed esummary error {s.status_code}",
80
+ "reason": s.reason,
81
+ }
82
+
83
+ result = s.json().get("result", {})
84
+ uids = result.get("uids", [])
85
+ articles = []
86
+ for uid in uids:
87
+ rec = result.get(uid, {})
88
+ title = rec.get("title")
89
+ journal = rec.get("fulljournalname") or rec.get("source")
90
+ year = None
91
+ pubdate = rec.get("pubdate")
92
+ if pubdate and len(pubdate) >= 4 and pubdate[:4].isdigit():
93
+ year = int(pubdate[:4])
94
+ doi = None
95
+ for id_obj in rec.get("articleids", []):
96
+ if id_obj.get("idtype") == "doi":
97
+ doi = id_obj.get("value")
98
+ break
99
+ url = f"https://pubmed.ncbi.nlm.nih.gov/{uid}/"
100
+ articles.append(
101
+ {
102
+ "title": title,
103
+ "journal": journal,
104
+ "year": year,
105
+ "doi": doi,
106
+ "url": url,
107
+ }
108
+ )
109
+
110
+ return articles
@@ -17,7 +17,7 @@ except FileNotFoundError as e:
17
17
  )
18
18
  sys.exit(1)
19
19
 
20
- server = FastMCP("Your MCP Server", stateless_http=True)
20
+ server = FastMCP("Your MCP Server")
21
21
  agents = {}
22
22
  for tool_config in boltz_tools:
23
23
  agents[tool_config["name"]] = Boltz2DockingTool(tool_config=tool_config)
@@ -47,4 +47,4 @@ def run_boltz2(query: dict):
47
47
 
48
48
 
49
49
  if __name__ == "__main__":
50
- server.run(transport="streamable-http", host="0.0.0.0", port=8080)
50
+ server.run(transport="streamable-http", host="0.0.0.0", port=8080, stateless_http=True)
@@ -18,7 +18,7 @@ except FileNotFoundError as e:
18
18
  )
19
19
  sys.exit(1)
20
20
 
21
- server = FastMCP("Your MCP Server", stateless_http=True)
21
+ server = FastMCP("Your MCP Server")
22
22
  agents = {}
23
23
  for tool_config in uspto_downloader_tools:
24
24
  agents[tool_config["name"]] = USPTOPatentDocumentDownloader(tool_config=tool_config)
@@ -58,4 +58,4 @@ def download_full_text(query: dict):
58
58
 
59
59
 
60
60
  if __name__ == "__main__":
61
- server.run(transport="streamable-http", host="0.0.0.0", port=8081)
61
+ server.run(transport="streamable-http", host="0.0.0.0", port=8081, stateless_http=True)