search-web
Search the web for real-time information, trusted facts, news, and source-backed content to answer questions and provide current data.
Instructions
Search the web in real time using Linkup. Use this tool whenever the user needs trusted facts, news, or source-backed information. Returns comprehensive content from the most relevant sources.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language search query. Full questions work best, e.g., 'How does the new EU AI Act affect startups?' | |
| depth | Yes | The search depth to perform. Use 'standard' for queries with likely direct answers. Use 'deep' for complex queries requiring comprehensive analysis or multi-hop questions |
Implementation Reference
- src/mcp_search_linkup/server.py:54-85 (handler)The call_tool handler specifically for 'search-web', which validates inputs, invokes LinkupClient.search, and formats the response as TextContent.@server.call_tool() async def handle_call_tool( name: str, arguments: dict | None, ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]: """Handle search tool execution requests.""" if name != "search-web": raise ValueError(f"Unknown tool: {name}") if not arguments: raise ValueError("Missing arguments") query = arguments.get("query") if not query: raise ValueError("Missing query") depth = arguments.get("depth") if not depth: raise ValueError("Missing depth") client = LinkupClient() search_response = client.search( query=query, depth=depth, output_type="searchResults", ) return [ types.TextContent( type="text", text=str(search_response), ) ]
- JSON schema defining the input parameters for the 'search-web' tool: query (string) and depth (enum: standard/deep).inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "Natural language search query. Full questions work best, e.g., 'How does the new EU AI Act affect startups?'", }, "depth": { "type": "string", "description": "The search depth to perform. Use 'standard' for " "queries with likely direct answers. Use 'deep' for complex queries " "requiring comprehensive analysis or multi-hop questions", "enum": ["standard", "deep"], }, }, "required": ["query", "depth"], },
- src/mcp_search_linkup/server.py:26-52 (registration)The list_tools handler that registers the 'search-web' tool with MCP server, providing name, description, and schema.@server.list_tools() async def handle_list_tools() -> list[types.Tool]: """List available search tools.""" return [ types.Tool( name="search-web", description="Search the web in real time using Linkup. Use this tool whenever the user needs trusted facts, news, or source-backed information. Returns comprehensive content from the most relevant sources.", inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "Natural language search query. Full questions work best, e.g., 'How does the new EU AI Act affect startups?'", }, "depth": { "type": "string", "description": "The search depth to perform. Use 'standard' for " "queries with likely direct answers. Use 'deep' for complex queries " "requiring comprehensive analysis or multi-hop questions", "enum": ["standard", "deep"], }, }, "required": ["query", "depth"], }, ) ]