Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Commit 5320305

Browse files
committed
Update prompt
1 parent 0f564af commit 5320305

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

src/mcp_search_linkup/server.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
import mcp.types as types
55
from mcp.server import NotificationOptions, Server
66
import mcp.server.stdio
7-
from pydantic import AnyUrl
87
import logging
98

109
server = Server("mcp-search-linkup")
1110
logger = logging.getLogger("mcp-search-linkup")
1211
logger.setLevel(logging.INFO)
1312

1413

15-
## Logging
1614
@server.set_logging_level()
1715
async def set_logging_level(level: types.LoggingLevel) -> types.EmptyResult:
1816
logger.setLevel(level.upper())
@@ -22,7 +20,6 @@ async def set_logging_level(level: types.LoggingLevel) -> types.EmptyResult:
2220
return types.EmptyResult()
2321

2422

25-
## Tools
2623
@server.list_tools()
2724
async def handle_list_tools() -> list[types.Tool]:
2825
"""
@@ -31,31 +28,29 @@ async def handle_list_tools() -> list[types.Tool]:
3128
return [
3229
types.Tool(
3330
name="search-web",
34-
description="Perform a web search query using Linkup. This tool is helpful for finding information on the web.",
31+
description="Performs an online search using Linkup search engine and retrieves the top results as a string. This function is useful for accessing real-time information, including news, articles, and other relevant web content.",
3532
inputSchema={
3633
"type": "object",
3734
"properties": {
3835
"query": {
3936
"type": "string",
40-
"description": "The query to search the web with. This should be a question, no need to write in keywords.",
37+
"description": "The search query to perform.",
4138
},
39+
"depth": {
40+
"type": "string",
41+
"description": "The search depth to perform. Use 'standard' for straightforward queries with likely direct answers (e.g., facts, definitions, simple explanations). Use 'deep' for: 1) complex queries requiring comprehensive analysis or information synthesis, 2) queries containing uncommon terms, specialized jargon, or abbreviations that may need additional context, or 3) questions likely requiring up-to-date or specialized web search results to answer effectively.",
42+
"enum": ["standard", "deep"],
43+
}
4244
},
43-
"required": ["query"],
45+
"required": ["query", "depth"],
4446
},
4547
)
4648
]
4749

4850

4951
@server.call_tool()
50-
async def handle_call_tool(
51-
name: str, arguments: dict | None
52+
async def handle_call_tool(arguments: dict | None
5253
) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
53-
"""
54-
Handle search tool execution requests.
55-
"""
56-
if name != "search-web":
57-
raise ValueError(f"Unknown tool: {name}")
58-
5954
if not arguments:
6055
raise ValueError("Missing arguments")
6156

@@ -65,7 +60,7 @@ async def handle_call_tool(
6560
raise ValueError("Missing query")
6661

6762
client = LinkupClient()
68-
# Perform the search using LinkupClient
63+
6964
search_response = client.search(
7065
query=query,
7166
depth="standard",
@@ -81,7 +76,6 @@ async def handle_call_tool(
8176

8277

8378
async def main():
84-
# Run the server using stdin/stdout streams
8579
async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
8680
await server.run(
8781
read_stream,

0 commit comments

Comments
 (0)