Skip to main content
Glama

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
NameRequiredDescriptionDefault
urlYesProduct 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"![Price History Graph]({ret.graph_link})", ).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' """
  • Registers the price_history_with_url tool handler with the MCP server instance.
    server.add_tool(price_history_with_url)
  • Imports the price_history_with_url tool handler from the tools module for server registration.
    from ..tools.price_history import ( price_history_with_url, )

Other 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/Funmula-Corp/BigGo-MCP-Server'

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