Skip to main content
Glama

get_publisher_details

Retrieve detailed information about Polish legal publishers, including act counts and publication timelines, for legal research and analysis.

Instructions

Get detailed information about a specific legal publisher including act counts and publication timeline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publisherYesPublisher code (DU for Dziennik Ustaw, MP for Monitor Polski)

Implementation Reference

  • app.py:368-372 (registration)
    Registration of the 'get_publisher_details' tool using the @app.tool decorator, specifying name, description, and tags.
    @app.tool(
        name="get_publisher_details",
        description="Get detailed information about a specific legal publisher including act counts and publication timeline.",
        tags={"metadata", "publishers", "reference", "sources"}
    )
  • app.py:373-414 (handler)
    The handler function 'get_publisher_info' that executes the tool logic: takes publisher code, fetches detailed info (acts count, years, etc.) from Sejm API endpoint https://api.sejm.gov.pl/eli/acts/{publisher}, handles errors by returning empty dict.
    def get_publisher_info(
        publisher: Annotated[str, "Publisher code (DU for Dziennik Ustaw, MP for Monitor Polski)"]
    ) -> dict:
        """Fetches detailed information about a specific legal act publisher.
    
        Provides comprehensive metadata about a legal publisher including publication
        statistics, available years, and document counts. This information is useful
        for understanding the scope and coverage of different legal gazettes.
    
        Args:
            publisher: Publisher code (e.g., 'DU' for Dziennik Ustaw, 'MP' for Monitor Polski).
    
        Returns:
            dict: Detailed information about the publisher containing code, name, shortName,
                  actsCount, and years array. Returns empty dict if publisher not found or error.
    
        Examples:
            User asks: "Tell me about DU publisher":
                Parameters: publisher = 'DU'
                Returns: {'code': 'DU', 'name': 'Dziennik Ustaw', 'shortName': 'Dz.U.', 'actsCount': 96086, 'years': [1918, 1919, ...]}
            User asks: "What is the Dziennik Ustaw?":
                Parameters: publisher = 'DU'
            User asks: "Give me details about Monitor Polski":
                Parameters: publisher = 'MP'
            User asks: "How many acts are in DU?":
                Parameters: publisher = 'DU'
            User asks: "What years are covered by MP?":
                Parameters: publisher = 'MP'
        """
        logger.debug(f"get_publisher_info called with publisher: {publisher}")
        try:
            url = f"https://api.sejm.gov.pl/eli/acts/{publisher}"
            logger.debug(f"Making GET request to: {url}")
            response = requests.get(url, headers={"Accept": "application/json"})
            response.raise_for_status()
    
            data = response.json()
            logger.info(f"get_publisher_info retrieved details for publisher: {publisher}")
            return data
        except Exception as e:
            logger.error(f"Error: {e}")
            return {}
  • Input schema definition using Annotated type hint for the 'publisher' parameter (string, e.g., 'DU' or 'MP').
    publisher: Annotated[str, "Publisher code (DU for Dziennik Ustaw, MP for Monitor Polski)"]

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