suse-documentation-mcp-server 0.9.0__py3-none-any.whl → 0.10.0__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.
@@ -73,23 +73,39 @@ def get_web_search_results_from_oi(query):
73
73
  return combined_response
74
74
 
75
75
  @mcp.tool()
76
- async def get_web_search_results(query: str) -> str:
76
+ async def get_web_search_results(input_data: Any) -> str:
77
77
  """
78
78
  Search SUSE documentation using web search and return results.
79
79
 
80
80
  This function is designed to perform a web search on the SUSE documentation
81
81
  for a given query and return the results. The function takes a search query as
82
- a string, performs the web search, and returns a formatted string containing
83
- the content from the search results.
82
+ a string, JSON object, or dictionary, normalizes it, performs the web search,
83
+ and returns a formatted string containing the content from the search results.
84
84
 
85
85
  Args:
86
- query (str): Web search query
87
- Examples: "sriov in rke2", "how to configure suse manager", "latest rancher version"
86
+ input_data (Any): Web search query, either as a string, JSON object, or dictionary.
87
+ Examples:
88
+ - "sriov in rke2"
89
+ - {"query": "how to configure suse manager"}
90
+ - {"queries": "latest rancher version"}
88
91
 
89
92
  Returns:
90
93
  str: Combined content from the search results, cleaned and formatted
91
94
  """
92
95
  try:
96
+ # Normalize input to extract the query string
97
+ if isinstance(input_data, str):
98
+ query = input_data
99
+ elif isinstance(input_data, dict):
100
+ query = input_data.get("query") or input_data.get("queries")
101
+ if not query:
102
+ raise ValueError("Input dictionary must contain 'query' or 'queries' key.")
103
+ else:
104
+ raise TypeError("Input must be a string or a dictionary containing 'query' or 'queries'.")
105
+
106
+ # Ensure query is a string
107
+ if not isinstance(query, str):
108
+ raise ValueError("The extracted query must be a string.")
93
109
  return get_web_search_results_from_oi(query)
94
110
  except Exception as e:
95
111
  return f"Error performing web search: {str(e)}\n\n{query}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: suse-documentation-mcp-server
3
- Version: 0.9.0
3
+ Version: 0.10.0
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -0,0 +1,6 @@
1
+ server/search_suse_documentation.py,sha256=crkGswuhJYCpxcm3GH_DmrfPt2Y6yB-_bpR2yyIyrg4,4468
2
+ suse_documentation_mcp_server-0.10.0.dist-info/METADATA,sha256=VljD_uATB0Ax-rXmqub9mUjDXZ72DI_wUpzOqqegrPE,344
3
+ suse_documentation_mcp_server-0.10.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ suse_documentation_mcp_server-0.10.0.dist-info/entry_points.txt,sha256=IEM7kH8YFWMMJCcp4hJGv5tHzHWxiR5lZ7jOyzRCHQA,88
5
+ suse_documentation_mcp_server-0.10.0.dist-info/top_level.txt,sha256=StKOSmRhvWS5IPcvhsDRbtxUTEofJgYFGOu5AAJdSWo,7
6
+ suse_documentation_mcp_server-0.10.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- server/search_suse_documentation.py,sha256=ttI02m2_Bc4IboHGOlr9MAVqlTFGba7HGUT0IbZed64,3664
2
- suse_documentation_mcp_server-0.9.0.dist-info/METADATA,sha256=0cJ3fDbAl3oSY-TjclN2g9W0wRsttLS54IL3zddAYAg,343
3
- suse_documentation_mcp_server-0.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
- suse_documentation_mcp_server-0.9.0.dist-info/entry_points.txt,sha256=IEM7kH8YFWMMJCcp4hJGv5tHzHWxiR5lZ7jOyzRCHQA,88
5
- suse_documentation_mcp_server-0.9.0.dist-info/top_level.txt,sha256=StKOSmRhvWS5IPcvhsDRbtxUTEofJgYFGOu5AAJdSWo,7
6
- suse_documentation_mcp_server-0.9.0.dist-info/RECORD,,