price_history_with_url
Track and analyze historical price changes for products by entering their URL, enabling informed purchasing decisions and cost monitoring.
Instructions
Product Price History With URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Product URL |
Implementation Reference
- The main asynchronous handler function implementing the 'price_history_with_url' tool. It fetches product price history using the provided URL via PriceHistoryService and formats the response with a description and markdown graph image.async def price_history_with_url( ctx: Context, url: Annotated[str, Field(description="Product URL")], ) -> str: """Product Price History With URL""" logger.info("price history with url, url: %s", url) setting = get_setting(ctx) service = PriceHistoryService(setting) ret = await service.history_with_url(url=url, days="180") if ret is None: return "No price history found" return PriceHistoryToolResponse( price_history_description=ret.description, price_history_graph=f"", ).slim_dump()
- Pydantic model defining the structured output response for the price_history_with_url tool, including price history details, graph markdown, and display instructions.class PriceHistoryToolResponse(BaseToolResponse): price_history_description: PriceHistoryAPIRet price_history_graph: str display_rules: str = """ Field explanation: 'price_history_description': includes detailed price history info. 'price_history_graph': includes a markdown image link used for visualizing price history. Here are a list of rules you must follow: Rule 1: Both 'price_history_description' and the link provided at 'price_history_graph' field must be included in the output. Rule 2: Product url must be included, it can be found in 'price_history_description' """
- src/biggo_mcp_server/lib/server_setup.py:21-24 (registration)Location where the price_history_with_url tool handler is registered with the BigGoMCPServer instance.# Price History # server.add_tool(price_history_graph) # server.add_tool(price_history_with_history_id) server.add_tool(price_history_with_url)