Skip to main content
Glama

detail_subjektu

Retrieve complete details for Slovak legal entities by IČO number, including statutory representatives, shareholders, business activities, legal form, and address. Optionally access historical records like former executives and previous addresses.

Instructions

Vráti kompletný detail právnickej osoby z RPO podľa IČO. Obsahuje štatutárov, spoločníkov, predmety činnosti, právnu formu a adresu. Ak historia=True, vráti aj historické záznamy (bývalí konatelia, staré adresy atď.).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
icoYes
historiaNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'detail_subjektu' MCP tool. It fetches details from the RPO API based on the provided IČO.
    async def detail_subjektu(ico: str, historia: bool = False) -> dict:
        """
        Vráti kompletný detail právnickej osoby z RPO podľa IČO.
        Obsahuje štatutárov, spoločníkov, predmety činnosti, právnu formu a adresu.
        Ak historia=True, vráti aj historické záznamy (bývalí konatelia, staré adresy atď.).
        """
        async with httpx.AsyncClient(timeout=15) as client:
            # Krok 1: Vyhľadaj RPO ID podľa IČO
            r = await client.get(f"{RPO_BASE}/search", params={"identifier": ico})
            r.raise_for_status()
            search_data = r.json()
    
            results = search_data.get("results", [])
            if not results:
                return {"chyba": f"Subjekt s IČO {ico} nebol nájdený v RPO"}
    
            rpo_id = results[0]["id"]
    
            # Krok 2: Načítaj kompletný detail podľa RPO ID
            params = {}
            if historia:
                params["showHistoricalData"] = "true"
    
            r = await client.get(f"{RPO_BASE}/entity/{rpo_id}", params=params)
            r.raise_for_status()
            data = r.json()
    
        # IČO
        identifiers = data.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
        names = data.get("fullNames", [])
        current_name = current_only(names)
        nazov_val = current_name[0]["value"] if current_name else (names[-1]["value"] if names else None)
    
        # Právna forma
        legal_forms = data.get("legalForms", [])
        current_lf = current_only(legal_forms)
        lf = current_lf[0] if current_lf else (legal_forms[0] if legal_forms else {})
        pravna_forma = lf.get("value", {}).get("value", None) if lf else None
    
        # Adresa
        addresses = data.get("addresses", [])
        current_addr = current_only(addresses)
        addr = current_addr[0] if current_addr else (addresses[0] if addresses else {})
    
        # Štatutárne orgány (konatelia, predseda predstavenstva, atď.)
        statutory = data.get("statutoryBodies", [])
        if not historia:
            statutory = current_only(statutory)
    
        statutari = []
        for s in statutory:
            person = s.get("personName", {})
            company = s.get("companyName", {})
            name = person.get("formatedName") or company.get("value") or "neznámy"
            stype = s.get("stakeholderType", {}).get("value", "")
            statutari.append({
                "meno": name,
                "funkcia": stype,
                "od": s.get("validFrom"),
                "do": s.get("validTo"),
                "adresa": format_address(s["address"]) if s.get("address") else None,
            })
    
        # Spoločníci / akcionári
        stakeholders = data.get("stakeholders", [])
        if not historia:
            stakeholders = current_only(stakeholders)
    
        spolocnici = []
        for s in stakeholders:
            person = s.get("personName", {})
            name = (
                person.get("formatedName")
                or s.get("fullName")
                or s.get("companyName", {}).get("value")
                or "neznámy"
            )
            stype = s.get("stakeholderType", {}).get("value", "")
            spolocnici.append({
                "nazov": name,
                "typ": stype,
                "ico": s.get("identifier") if s.get("identifier") != "Neuvedené" else None,
                "od": s.get("validFrom"),
                "do": s.get("validTo"),
                "adresa": format_address(s["address"]) if s.get("address") else None,
            })
    
        # Predmety činnosti
        activities = data.get("activities", [])
        if not historia:
            activities = current_only(activities)
    
        cinnosti = [a.get("economicActivityDescription") for a in activities if a.get("economicActivityDescription")]
    
        # Zdrojový register
        source = data.get("sourceRegister", {})
        source_name = source.get("value", {}).get("value", "") if isinstance(source.get("value"), dict) else ""
        reg_offices = source.get("registrationOffices", [])
        reg_numbers = source.get("registrationNumbers", [])
        current_office = current_only(reg_offices)
        current_regnum = current_only(reg_numbers)
    
        return {
            "rpo_id": data.get("id"),
            "ico": ico_val,
            "nazov": nazov_val,
            "pravna_forma": pravna_forma,
            "adresa": format_address(addr) if addr else None,
            "datum_vzniku": data.get("establishment"),
            "datum_zaniku": data.get("termination"),
            "zdrojovy_register": source_name,
            "registrovy_sud": current_office[0].get("value") if current_office else None,
            "spisova_znacka": current_regnum[0].get("value") if current_regnum else None,
            "statutari": statutari,
            "spolocnici": spolocnici,
            "cinnosti": cinnosti,
            "pravne_poradenstvo": PRAVNE_PORADENSTVO,
        }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It clearly describes what data is returned (statutory representatives, partners, business activities, legal form, address) and the effect of the 'historia' parameter on historical records. However, it doesn't mention error conditions, rate limits, authentication requirements, or data freshness.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with zero waste. The first states the core purpose, the second lists returned data fields, and the third explains the optional parameter's effect. Each sentence earns its place by adding distinct value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no annotations, but has output schema), the description is reasonably complete. It explains what data is returned and parameter effects. The existence of an output schema reduces the need to describe return values in detail. Minor gaps include lack of error handling information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate. It explains both parameters: 'ico' as the identifier for the legal entity and 'historia' as a boolean controlling whether historical records are included. This adds meaningful context beyond the bare schema, though it doesn't specify format requirements for 'ico'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Vráti kompletný detail' - returns complete detail), the resource ('právnickej osoby z RPO' - legal entity from RPO), and the key identifier ('podľa IČO' - by IČO). It distinguishes from the sibling tool 'hladaj_subjekt' (search subject) by focusing on detailed retrieval rather than searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when detailed information about a specific legal entity is needed, but doesn't explicitly state when to use this versus the sibling 'hladaj_subjekt' or any other alternatives. It mentions the 'historia' parameter for historical records, which provides some contextual guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/LegalEngineering/sk-registers-mcp'

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