search_whitepaper
Find and retrieve cryptocurrency whitepapers by searching DuckDuckGo. Input a project name to receive a JSON list of relevant PDFs, including titles, URLs, and snippets.
Instructions
Search for a cryptocurrency project's whitepaper PDF using DuckDuckGo.
Parameters:
project_name (str): The name of the cryptocurrency project (e.g., 'bitcoin', 'ethereum').
Returns:
str: A JSON-formatted list of search results with title, URL, and snippet.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_name | Yes |
Implementation Reference
- src/crypto_whitepapers_mcp/cli.py:42-42 (registration)Registration of the 'search_whitepaper' tool using the @mcp.tool() decorator on the handler function.@mcp.tool()
- src/crypto_whitepapers_mcp/cli.py:43-62 (handler)The handler function that implements the logic for the 'search_whitepaper' tool. It performs a DuckDuckGo search for the project's whitepaper PDF and returns formatted JSON results.def search_whitepaper(project_name: str, ctx: Context = None) -> str: """Search for a cryptocurrency project's whitepaper PDF using DuckDuckGo. Parameters: project_name (str): The name of the cryptocurrency project (e.g., 'bitcoin', 'ethereum'). Returns: str: A JSON-formatted list of search results with title, URL, and snippet. """ try: with DDGS() as ddgs: query = f"{project_name} whitepaper filetype:pdf" results = ddgs.text(keywords=query, max_results=5) formatted_results = [ {"title": r["title"], "url": r["href"], "snippet": r["body"]} for r in results ] return json.dumps(formatted_results, indent=2) except Exception as e: return f"Error searching for {project_name} whitepaper: {str(e)}"