price_history_with_url
Track product price changes over time by providing a product URL. This tool retrieves historical pricing data to help identify trends and optimal purchase timing.
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 for the 'price_history_with_url' tool. It accepts a product URL, retrieves the price history via PriceHistoryService, and returns a markdown-formatted response including description and 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 description, 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:24-24 (registration)Registers the price_history_with_url tool handler with the MCP server instance.server.add_tool(price_history_with_url)
- src/biggo_mcp_server/lib/server_setup.py:3-5 (registration)Imports the price_history_with_url tool handler from the tools module for server registration.from ..tools.price_history import ( price_history_with_url, )