Skip to main content
Glama

get_act_relationships

Analyze legal relationships and references for Polish acts to identify amendments, citations, and connections between legal documents.

Instructions

Analyze legal relationships and references for an act. Shows which acts it amends, references, or is referenced by.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publisherYesPublisher code (DU for Dziennik Ustaw, MP for Monitor Polski)
yearYesPublication year
numYesAct number/position within the year

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • app.py:637-682 (handler)
    The handler function (named get_act_references) that implements the core logic for the 'get_act_relationships' tool. It fetches legal relationships and references from the Sejm API endpoint /eli/acts/{publisher}/{year}/{num}/references.
    def get_act_references(
        publisher: Annotated[str, "Publisher code (DU for Dziennik Ustaw, MP for Monitor Polski)"],
        year: Annotated[int, "Publication year"],
        num: Annotated[Union[int, str], "Act number/position within the year"]
    ) -> dict:
        """Fetches references to/from a specific legal act (acts that reference this act or are referenced by this act).
    
        Analyzes the legal relationships and dependencies of a specific act, showing which
        acts it amends, references, or is referenced by. This helps understand the legal
        context and impact of the document within the broader legal framework.
    
        Args:
            publisher: Publication code (e.g., 'DU' for Dziennik Ustaw, 'MP' for Monitor Polski).
            year: Year of publication as integer.
            num: Act number/position within the year as integer or string.
    
        Returns:
            dict: Dictionary organized by reference types (e.g., 'Akty zmienione', 'Akty uchylone')
                  with arrays of referenced acts and their relationship details. Returns empty dict
                  if no references found or error occurs.
    
        Examples:
            User asks: "What acts reference DU/2020/1?":
                Parameters: publisher = 'DU', year = 2020, num = 1
                Returns: {'Akty zmienione': [{'act': {'ELI': 'DU/2016/1498', ...}, 'date': '2020-01-17'}], ...}
            User asks: "Show me references for act MP/2023/25":
                Parameters: publisher = 'MP', year = 2023, num = 25
            User asks: "What laws does DU/2019/50 reference?":
                Parameters: publisher = 'DU', year = 2019, num = 50
            User asks: "Find acts that amended DU/2022/100":
                Parameters: publisher = 'DU', year = 2022, num = 100
            User asks: "What is the legal basis for act DU/2021/75?":
                Parameters: publisher = 'DU', year = 2021, num = 75
        """
        logger.debug(f"get_act_references called with: publisher={publisher}, year={year}, num={num}")
        try:
            url = f"https://api.sejm.gov.pl/eli/acts/{publisher}/{year}/{num}/references"
            response = requests.get(url, headers={"Accept": "application/json"})
            response.raise_for_status()
    
            data = response.json()
            logger.info(f"get_act_references retrieved references for act: {publisher}/{year}/{num}")
            return data
        except Exception as e:
            logger.error(f"Error: {e}")
            return {}
  • app.py:632-636 (registration)
    The @app.tool decorator that registers the handler function as the MCP tool named 'get_act_relationships' with description and tags.
    @app.tool(
        name="get_act_relationships",
        description="Analyze legal relationships and references for an act. Shows which acts it amends, references, or is referenced by.",
        tags={"analysis", "references", "relationships", "legal-network"}
    )
  • Input schema defined by type annotations with descriptions for publisher (str), year (int), num (Union[int,str]), output dict.
        publisher: Annotated[str, "Publisher code (DU for Dziennik Ustaw, MP for Monitor Polski)"],
        year: Annotated[int, "Publication year"],
        num: Annotated[Union[int, str], "Act number/position within the year"]
    ) -> dict:
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it describes the analysis function, it lacks critical behavioral details: whether this is a read-only operation, what format the output takes (though output schema exists), potential rate limits, authentication requirements, or any side effects. The description provides basic functionality but misses important operational context.

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?

Two tightly focused sentences with zero waste. The first sentence establishes core purpose, the second specifies scope. Every word contributes directly to understanding the tool's function without redundancy or unnecessary elaboration.

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 3 required parameters with full schema coverage and an output schema, the description provides adequate context for a read/analysis tool. It clearly states what the tool does and its specific focus area. The main gap is lack of behavioral transparency (no annotations), but the existence of output schema means return values are documented elsewhere, making the description reasonably complete for its purpose.

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

Parameters3/5

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

Schema description coverage is 100%, providing complete parameter documentation. The description adds no parameter-specific information beyond what's in the schema. However, it does provide overall context that these parameters identify 'an act' for relationship analysis, which gives semantic meaning to the parameter combination. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('analyze legal relationships and references') and resource ('for an act'), with explicit scope ('shows which acts it amends, references, or is referenced by'). It distinguishes from siblings like get_act_content or get_act_comprehensive_details by focusing specifically on relationship analysis rather than content or general details.

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 context through 'analyze legal relationships' but provides no explicit guidance on when to use this tool versus alternatives like get_act_comprehensive_details (which might include relationships) or search_legal_acts. No when-not-to-use scenarios or prerequisite information is mentioned.

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/numikel/law-scrapper-mcp'

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