Skip to main content
Glama
barvhaim

Israeli Land Authority MCP Server

by barvhaim

search_tenders

Search Israeli land tenders with filters for type, location, status, date ranges, and priority populations using Hebrew text.

Instructions

Search for land tenders from the Israeli Land Authority

Enhanced search with comprehensive filtering options including tender types, locations, statuses, date ranges, and priority populations. Supports Hebrew text and backward compatibility.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsYes

Implementation Reference

  • The core handler function for the 'search_tenders' MCP tool. It processes complex arguments, handles legacy params, date parsing, settlement code resolution, calls the API client, and formats the response with a search summary.
    @mcp.tool()
    def search_tenders(args: SearchTendersArgs) -> Dict[str, Any]:
        """
        Search for land tenders from the Israeli Land Authority
    
        Enhanced search with comprehensive filtering options including tender types, locations,
        statuses, date ranges, and priority populations. Supports Hebrew text and backward compatibility.
        """
        try:
            # Handle date range conversion
            submission_date_from = None
            submission_date_to = None
            publication_date_from = None
            publication_date_to = None
    
            # New date range format
            if args.submission_deadline:
                if args.submission_deadline.from_date:
                    submission_date_from = datetime.strptime(
                        args.submission_deadline.from_date, "%d/%m/%y"
                    )
                if args.submission_deadline.to_date:
                    submission_date_to = datetime.strptime(
                        args.submission_deadline.to_date, "%d/%m/%y"
                    )
    
            if args.publication_date:
                if args.publication_date.from_date:
                    publication_date_from = datetime.strptime(
                        args.publication_date.from_date, "%d/%m/%y"
                    )
                if args.publication_date.to_date:
                    publication_date_to = datetime.strptime(
                        args.publication_date.to_date, "%d/%m/%y"
                    )
    
            # Legacy compatibility for days_back
            if args.days_back and not submission_date_from:
                submission_date_from = datetime.now() - timedelta(days=args.days_back)
    
            # Handle legacy parameters
            legacy_purpose = args.purpose
            legacy_region = args.region
    
            # Handle settlement name to kod_yeshuv conversion
            final_kod_yeshuv = args.kod_yeshuv
            if args.settlement and not args.kod_yeshuv:
                # Try to convert settlement name to kod_yeshuv
                for settlement in KOD_YESHUV_SETTLEMENTS:
                    if settlement.name_hebrew == args.settlement.strip():
                        final_kod_yeshuv = settlement.kod_yeshuv
                        break
    
            # Handle committee date ranges
            committee_date_from = None
            committee_date_to = None
            if args.committee_date:
                if args.committee_date.from_date:
                    committee_date_from = datetime.strptime(
                        args.committee_date.from_date, "%d/%m/%y"
                    )
                if args.committee_date.to_date:
                    committee_date_to = datetime.strptime(
                        args.committee_date.to_date, "%d/%m/%y"
                    )
    
            # Call API with enhanced parameters
            results = api_client.search_tenders(
                tender_number=args.tender_number,
                tender_types=args.tender_types,
                settlement=(
                    args.settlement if not final_kod_yeshuv else None
                ),  # Only pass if no kod_yeshuv
                kod_yeshuv=final_kod_yeshuv,
                neighborhood=args.neighborhood,
                purpose=legacy_purpose,  # Legacy support
                region=legacy_region,  # Legacy support
                submission_date_from=submission_date_from,
                submission_date_to=submission_date_to,
                publication_date_from=publication_date_from,
                publication_date_to=publication_date_to,
                committee_date_from=committee_date_from,
                committee_date_to=committee_date_to,
                tender_purposes=args.tender_purposes,
                regions=args.regions,
                tender_statuses=args.tender_statuses,
                priority_populations=args.priority_populations,
                active_only=args.active_only,
                quick_search=args.quick_search,
                page_size=min(args.max_results, 1000),
            )
    
            # Process results
            if isinstance(results, list):
                tender_list = results[: args.max_results]
            else:
                tender_list = results.get("results", results)[: args.max_results]
    
            # Prepare search summary
            search_summary = {
                "parameters_used": args.model_dump(exclude_unset=True),
                "new_features": {
                    "enhanced_date_ranges": bool(
                        args.submission_deadline or args.publication_date
                    ),
                    "priority_populations": bool(args.priority_populations),
                    "multiple_statuses": bool(args.tender_statuses),
                    "multiple_purposes": bool(args.tender_purposes),
                    "multiple_regions": bool(args.regions),
                },
                "settlement_conversion": {
                    "settlement_name_provided": bool(args.settlement),
                    "kod_yeshuv_resolved": (
                        final_kod_yeshuv
                        if args.settlement and not args.kod_yeshuv
                        else None
                    ),
                    "conversion_successful": bool(
                        args.settlement and not args.kod_yeshuv and final_kod_yeshuv
                    ),
                },
            }
    
            return {
                "success": True,
                "count": len(tender_list),
                "tenders": tender_list,
                "search_summary": search_summary,
            }
    
        except Exception as e:
            return {
                "success": False,
                "error": str(e),
                "search_parameters": args.model_dump(exclude_unset=True),
            }
  • Input schema (Pydantic model) for the search_tenders tool, defining all parameters with descriptions, types, and Field metadata including legacy deprecated fields.
    class SearchTendersArgs(BaseModel):
        """Arguments for search_tenders tool"""
    
        # Basic search parameters
        tender_number: Optional[str] = Field(
            None, description="Specific tender number to search for (מספר מכרז)"
        )
        tender_types: Optional[List[int]] = Field(
            None, description="List of tender type IDs (סוג המכרז)"
        )
        settlement: Optional[str] = Field(
            None, description="Settlement name in Hebrew (יישוב)"
        )
        kod_yeshuv: Optional[int] = Field(None, description="Settlement code (Kod Yeshuv)")
        neighborhood: Optional[str] = Field(
            None, description="Neighborhood name in Hebrew (שכונה)"
        )
        tender_purposes: Optional[List[int]] = Field(
            None, description="List of tender purpose/designation IDs (ייעוד מכרז)"
        )
        regions: Optional[List[int]] = Field(
            None, description='List of Rami region IDs (מרחב ברמ"י)'
        )
        tender_statuses: Optional[List[int]] = Field(
            None, description="List of tender status IDs (סטטוס המכרז)"
        )
    
        # Date range filters
        submission_deadline: Optional[DateRange] = Field(
            None, description="Submission deadline date range (מועד אחרון להגשת הצעות)"
        )
        committee_date: Optional[DateRange] = Field(
            None, description="Committee date range (ועדת מכרזים)"
        )
        publication_date: Optional[DateRange] = Field(
            None, description="Publication date range (פרסום מכרז)"
        )
    
        # Priority populations
        priority_populations: Optional[List[int]] = Field(
            None, description="Priority population codes (אוכלוסיות עדיפות)"
        )
    
        # Search mode and result controls
        active_only: bool = Field(False, description="Only return active tenders")
        quick_search: bool = Field(False, description="Use quick search mode")
        max_results: int = Field(100, description="Maximum number of results to return")
    
        # Legacy compatibility (deprecated)
        purpose: Optional[str] = Field(
            None,
            description="Legacy: Land use purpose (use tender_purposes instead)",
            deprecated=True,
        )
        region: Optional[str] = Field(
            None, description="Legacy: Region name (use regions instead)", deprecated=True
        )
        days_back: Optional[int] = Field(
            None,
            description="Legacy: Search tenders from last N days (use date ranges instead)",
            deprecated=True,
        )
  • Central registration function for all MCP tools, invoking register_tender_tools which defines and registers the search_tenders tool using @mcp.tool() decorator.
    def register_tools(mcp, api_client):
        """Register all MCP tools"""
        register_tender_tools(mcp, api_client)
        register_settlement_tools(mcp, api_client)
  • Invocation of tool registration in the main server creation function, initializing the MCP server with all tools including search_tenders.
    # Register tools and resources
    register_tools(mcp, api_client)
    register_resources(mcp)

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/barvhaim/remy-mcp'

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