1010import os
1111# Initialize the LinkupClient
1212
13- client = LinkupClient ()
14-
1513server = Server ("mcp-search-linkup" )
1614logger = logging .getLogger ("mcp-search-linkup" )
1715logger .setLevel (logging .INFO )
@@ -60,16 +58,21 @@ async def handle_list_tools() -> list[types.Tool]:
6058 inputSchema = {
6159 "type" : "object" ,
6260 "properties" : {
63- "query" : {"type" : "string" },
61+ "query" : {
62+ "type" : "string" ,
63+ "description" : "The query to search the web with. This should be a question, no need to write in keywords."
64+ },
6465 "depth" : {
6566 "type" : "string" ,
6667 "enum" : ["standard" , "deep" ],
67- "default" : "standard"
68+ "default" : "standard" ,
69+ "description" : "The depth of the search. Standard is a basic search while deep takes more time to complete but can answer more complex questions."
6870 },
6971 "output_type" : {
7072 "type" : "string" ,
7173 "enum" : ["searchResults" , "sourcedAnswer" , "structured" ],
72- "default" : "sourcedAnswer"
74+ "default" : "searchResults" ,
75+ "description" : "The type of output to return"
7376 }
7477 },
7578 "required" : ["query" ],
@@ -92,11 +95,12 @@ async def handle_call_tool(
9295
9396 query = arguments .get ("query" )
9497 depth = arguments .get ("depth" , "standard" )
95- output_type = arguments .get ("output_type" , "sourcedAnswer " )
98+ output_type = arguments .get ("output_type" , "searchResults " )
9699
97100 if not query :
98101 raise ValueError ("Missing query" )
99102
103+ client = LinkupClient ()
100104 # Perform the search using LinkupClient
101105 search_response = client .search (
102106 query = query ,
0 commit comments