get_recent_results
Retrieve completed Israeli land tenders with published results from recent days for market analysis and trend monitoring.
Instructions
Get tenders with results from recent days
Find completed tenders with published results for market analysis and trend monitoring.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | Yes |
Implementation Reference
- The main MCP tool handler function 'get_recent_results' decorated with @mcp.tool(). It takes RecentResultsArgs, calls the api_client helper, and returns formatted success/error response.@mcp.tool() def get_recent_results(args: RecentResultsArgs) -> Dict[str, Any]: """ Get tenders with results from recent days Find completed tenders with published results for market analysis and trend monitoring. """ try: results = api_client.get_recent_results(days=args.days) if isinstance(results, list): tender_list = results else: tender_list = results.get("results", results) return { "success": True, "count": len(tender_list), "days_back": args.days, "recent_results": tender_list, } except Exception as e: return {"success": False, "error": str(e), "days_back": args.days}
- Pydantic model RecentResultsArgs that defines the input schema for the tool, with a single 'days' parameter (int, default=30).class RecentResultsArgs(BaseModel): """Arguments for recent results query""" days: int = Field(30, description="Number of days to look back for results")
- Core API client method implementing get_recent_results by calling search_tenders with has_results=True and a date filter for the last N days.def get_recent_results(self, days: int = 30) -> List[Dict[str, Any]]: """ Get tenders with results from the last N days Args: days: Number of days to look back Returns: List of tenders with recent results """ date_from = datetime.now() - timedelta(days=days) return self.search_tenders( has_results=True, submission_date_from=date_from, page_size=10000 )