hladaj_subjekt
Search Slovak legal entities in the RPO register by name, IČO number, or municipality to find company details from official sources.
Instructions
Hľadá právnické osoby v RPO (Register právnických osôb) podľa názvu, IČO alebo obce. Aspoň jeden z parametrov nazov/ico musí byť zadaný. RPO agreguje dáta z ~70 zdrojových registrov (ORSR, ZRSR, a ďalšie).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nazov | No | ||
| ico | No | ||
| obec | No | ||
| iba_aktivne | No |
Implementation Reference
- server.py:51-116 (handler)Implementation of the `hladaj_subjekt` MCP tool, which searches for legal entities in the RPO database using the provided name, IČO, or municipality.
async def hladaj_subjekt( nazov: str = "", ico: str = "", obec: str = "", iba_aktivne: bool = True, ) -> dict: """ Hľadá právnické osoby v RPO (Register právnických osôb) podľa názvu, IČO alebo obce. Aspoň jeden z parametrov nazov/ico musí byť zadaný. RPO agreguje dáta z ~70 zdrojových registrov (ORSR, ZRSR, a ďalšie). """ if not nazov and not ico: return {"chyba": "Zadaj aspoň nazov alebo ico"} params = {} if ico: params["identifier"] = ico if nazov: params["fullName"] = nazov if obec: params["addressMunicipality"] = obec if iba_aktivne: params["onlyActive"] = "true" async with httpx.AsyncClient(timeout=15) as client: r = await client.get(f"{RPO_BASE}/search", params=params) r.raise_for_status() data = r.json() results = data.get("results", []) subjekty = [] for s in results: # IČO — aktuálne identifiers = s.get("identifiers", []) current_id = current_only(identifiers) ico_val = current_id[0]["value"] if current_id else (identifiers[0]["value"] if identifiers else None) # Názov — aktuálny names = s.get("fullNames", []) current_name = current_only(names) nazov_val = current_name[0]["value"] if current_name else (names[-1]["value"] if names else None) # Adresa — aktuálna addresses = s.get("addresses", []) current_addr = current_only(addresses) addr = current_addr[0] if current_addr else (addresses[0] if addresses else {}) # Zdrojový register source = s.get("sourceRegister", {}) source_name = source.get("value", {}).get("value", "") if isinstance(source.get("value"), dict) else "" subjekty.append({ "rpo_id": s.get("id"), "ico": ico_val, "nazov": nazov_val, "adresa": format_address(addr) if addr else None, "datum_vzniku": s.get("establishment"), "zdrojovy_register": source_name, }) return { "pocet": len(subjekty), "subjekty": subjekty, "pravne_poradenstvo": PRAVNE_PORADENSTVO, }