get_kod_yeshuv
Retrieve official Israeli settlement codes from Hebrew names for integration with government systems.
Instructions
Get Kod Yeshuv (settlement code) from Hebrew settlement name
Returns the official settlement code used by Israeli authorities for the given settlement name. Useful for integration with other Israeli government systems.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | Yes |
Implementation Reference
- The get_kod_yeshuv tool handler: searches for exact and partial matches in KOD_YESHUV_SETTLEMENTS data, returns settlement code or partial matches.@mcp.tool() def get_kod_yeshuv(args: KodYeshuvArgs) -> Dict[str, Any]: """ Get Kod Yeshuv (settlement code) from Hebrew settlement name Returns the official settlement code used by Israeli authorities for the given settlement name. Useful for integration with other Israeli government systems. """ try: # Search for exact match first settlement_name = args.settlement_name.strip() for settlement in KOD_YESHUV_SETTLEMENTS: if settlement.name_hebrew == settlement_name: return { "success": True, "settlement_name": settlement_name, "kod_yeshuv": settlement.kod_yeshuv, "match_type": "exact", } # Search for partial matches if no exact match found partial_matches = [] settlement_lower = settlement_name.lower() for settlement in KOD_YESHUV_SETTLEMENTS: name_lower = settlement.name_hebrew.lower() if settlement_lower in name_lower or name_lower in settlement_lower: partial_matches.append( { "settlement_name": settlement.name_hebrew, "kod_yeshuv": settlement.kod_yeshuv, "similarity": "partial", } ) if partial_matches: return { "success": True, "searched_name": settlement_name, "exact_match": False, "partial_matches": partial_matches[:10], # Limit to top 10 matches "match_type": "partial", } # No matches found return { "success": False, "error": f"No settlement found matching '{settlement_name}'", "searched_name": settlement_name, "suggestion": "Try using the exact Hebrew name or check the settlement name spelling", } except Exception as e: return { "success": False, "error": str(e), "searched_name": args.settlement_name, }
- KodYeshuvArgs Pydantic model defining the required 'settlement_name' (Hebrew string) input parameter.class KodYeshuvArgs(BaseModel): """Arguments for settlement code lookup""" settlement_name: str = Field( ..., description="Settlement name in Hebrew to get the Kod Yeshuv for" )
- src/remy_mcp/tools/__init__.py:5-12 (registration)Registers settlement tools by calling register_settlement_tools(mcp, api_client), which defines and registers get_kod_yeshuv via @mcp.tool().from .tender_tools import register_tender_tools from .settlement_tools import register_settlement_tools def register_tools(mcp, api_client): """Register all MCP tools""" register_tender_tools(mcp, api_client) register_settlement_tools(mcp, api_client)
- src/remy_mcp/server.py:20-20 (registration)Top-level call to register_tools(mcp, api_client) which chains to settlement tools registration including get_kod_yeshuv.register_tools(mcp, api_client)