Skip to main content
Glama

load_whitepaper

Load cryptocurrency project whitepapers into a structured knowledge base by providing the project name and PDF URL. Enables AI agents to access and analyze whitepaper content for enhanced learning.

Instructions

Load a whitepaper PDF from a URL into the knowledge base.

Parameters: project_name (str): The name of the cryptocurrency project (e.g., 'bitcoin', 'ethereum'). url (str): The URL of the whitepaper PDF to download and load. Returns: str: A message indicating success or failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_nameYes
urlYes

Implementation Reference

  • The main handler function for the 'load_whitepaper' tool. It is registered via the @mcp.tool() decorator. Downloads a PDF whitepaper from the provided URL, saves it locally, and loads it into the PDFKnowledgeBase for vector search.
    @mcp.tool() def load_whitepaper(project_name: str, url: str, ctx: Context = None) -> str: """Load a whitepaper PDF from a URL into the knowledge base. Parameters: project_name (str): The name of the cryptocurrency project (e.g., 'bitcoin', 'ethereum'). url (str): The URL of the whitepaper PDF to download and load. Returns: str: A message indicating success or failure. """ try: # Sanitize project name for filename safe_project_name = project_name.lower().replace(" ", "_") file_path = os.path.join(WHITEPAPERS_DIR, f"{safe_project_name}.pdf") # Download PDF urllib.request.urlretrieve(url, file_path) # Load into knowledge base knowledge_base.load() return f"Successfully loaded {project_name} whitepaper from {url}" except Exception as e: return f"Error loading {project_name} whitepaper: {str(e)}"

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kukapay/crypto-whitepapers-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server