Skip to main content
Glama

Wyszukiwanie aktów prawnych

search_legal_acts
Read-onlyIdempotent

Find Polish legal acts from Dziennik Ustaw and Monitor Polski by keyword, title, type, dates, and validity status. Filter results to locate applicable regulations.

Instructions

Wyszukaj polskie akty prawne z Dziennika Ustaw (DU) i Monitora Polskiego (MP).

UWAGA: Wszystkie słowa kluczowe muszą wystąpić jednocześnie (logika AND). Szukaj jednego słowa na raz dla logiki OR.

Kiedy użyć: Gdy znasz słowa kluczowe, tytuł, typ lub kryteria wyszukiwania. Kiedy NIE używać: Gdy chcesz przeglądać cały rocznik → użyj browse_acts.

Po wyszukiwaniu możesz użyć filter_results(result_set_id=...) aby dalej zawęzić wyniki (np. regex na tytułach, filtr po typie dokumentu).

Przykłady:

  • search_legal_acts(keywords=["podatek"], year=2024) - Akty podatkowe z 2024

  • search_legal_acts(act_type="Ustawa", title="zdrowotny") - Ustawy o zdrowiu

  • search_legal_acts(act_type="Rozporządzenie", year=2024, in_force=True) - Obowiązujące rozporządzenia z 2024

  • search_legal_acts(publisher="MP", year=2024, limit=10) - 10 aktów z MP z 2024

  • search_legal_acts(date_from="2024-01-01", date_to="2024-06-30") - Akty wchodzące w życie I poł. 2024

  • search_legal_acts(pub_date_from="2024-03-01", pub_date_to="2024-03-31") - Ogłoszone w marcu 2024

  • search_legal_acts(title="budżet", year=2024) - Akty budżetowe z 2024

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoRok publikacji (np. 2024).
limitNoMaksymalna liczba wyników do zwrócenia. Domyślnie 20. Przydatne do ograniczenia dużych zbiorów. Nie jest przycinana do 100 jak w pozostałych narzędziach listujących, ponieważ trafia wprost do zapytania do api.sejm.gov.pl — publicznej usługi instytucji państwowej. Podawaj najmniejszą wystarczającą wartość.
titleNoSzukaj w tytule aktu (dopasowanie podciągu). Np. 'budżet', 'przeciwpożarow', 'podatek dochodowy'.
offsetNoLiczba wyników do pominięcia (paginacja). Użyj z parametrem limit.
date_toNoData wejścia w życie DO (YYYY-MM-DD). Filtruje akty które weszły w życie do tej daty.
act_typeNoTyp dokumentu (dokładne dopasowanie). Dostępne wartości: 'Ustawa', 'Rozporządzenie', 'Obwieszczenie', 'Komunikat', 'Uchwała', 'Zarządzenie', 'Wyrok', 'Postanowienie', 'Oświadczenie rządowe'. Użyj get_system_metadata(category='types') aby zobaczyć pełną listę.
in_forceNoFiltruj po obowiązywaniu: true = tylko akty obecnie obowiązujące, false = tylko akty nieobowiązujące, None = wszystkie.
keywordsNoSłowa kluczowe z systemu Sejmu (logika AND — wiele słów zawęża wyniki). Aby uzyskać logikę OR, wykonaj oddzielne wyszukiwanie dla każdego słowa. Użyj get_system_metadata(category='keywords') aby poznać dostępne słowa kluczowe.
date_fromNoData wejścia w życie OD (YYYY-MM-DD). Filtruje akty które weszły w życie od tej daty.
publisherNoKod wydawcy: 'DU' (Dziennik Ustaw) lub 'MP' (Monitor Polski). Domyślnie 'DU'.DU
pub_date_toNoData publikacji/ogłoszenia DO (YYYY-MM-DD). Filtruje po dacie ogłoszenia w dzienniku.
detail_levelNoPoziom szczegółowości wyników: 'minimal' (ELI, tytuł, status), 'standard' (+ typ, daty, obowiązywanie), 'full' (wszystkie pola). Domyślnie 'standard'.standard
pub_date_fromNoData publikacji/ogłoszenia OD (YYYY-MM-DD). Filtruje po dacie ogłoszenia w dzienniku.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe actual response data
hintsNoSuggested next steps

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.4.0
    • removedOutput schema / properties / metadata
      Removed value: -{
      -  "additionalProperties": true,
      -  "description": "Additional metadata",
      -  "title": "Metadata",
      -  "type": "object"
      -}
  2. Changed5 schema fields changedv4.2.0
    • changedInput schema / properties / limit / description
      Previous value: -"Maksymalna liczba wyników do zwrócenia. Domyślnie 20. Przydatne do ograniczenia dużych zbiorów. Bez górnej granicy — w odróżnieniu od pozostałych narzędzi listujących, gdzie limit jest przycinany do 100."New value: +"Maksymalna liczba wyników do zwrócenia. Domyślnie 20. Przydatne do ograniczenia dużych zbiorów. Nie jest przycinana do 100 jak w pozostałych narzędziach listujących, ponieważ trafia wprost do zapytania do api.sejm.gov.pl — publicznej usługi instytucji państwowej. Podawaj najmniejszą wystarczającą wartość."
    • addedOutput schema / $defs / ActSummaryOutput / properties / effective_date / description
      Added value: +"Data wejścia w życie (entryIntoForce)."
    • addedOutput schema / $defs / ResultSetScope
      Added value: +{
      +  "description": "Zasięg zestawu wyników względem korpusu, z którego pochodzi.",
      +  "properties": {
      +    "corpus_count": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "Rozmiar korpusu, z którego pochodzi zestaw. None, gdy nieznany — tak jest dla zestawu powstałego z filtrowania okna: wiadomo, ile rekordów trafiło w oknie, nie wiadomo, ile rekordów korpusu pasowałoby do tych samych kryteriów.",
      +      "title": "Corpus Count"
      +    },
      +    "scope": {
      +      "$ref": "#/$defs/SetScope",
      +      "description": "'complete' — zestaw zawiera każdy rekord pasujący do zapytania w chwili wywołania. 'page' — zestaw jest oknem wyciętym z większego korpusu, więc brak dopasowania w filter_results NIE dowodzi, że akt nie istnieje w zbiorze."
      +    },
      +    "stored_count": {
      +      "description": "Liczba rekordów w tym zestawie.",
      +      "title": "Stored Count",
      +      "type": "integer"
      +    },
      +    "window_offset": {
      +      "description": "Pozycja początku okna w korpusie. Zero dla zestawu kompletnego.",
      +      "title": "Window Offset",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "scope",
      +    "stored_count",
      +    "window_offset"
      +  ],
      +  "title": "ResultSetScope",
      +  "type": "object"
      +}
    • addedOutput schema / $defs / SearchOutput / properties / result_set_scope
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/ResultSetScope"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Zasięg zapisanego zestawu wyników. None, gdy zestaw nie powstał (zero wyników). Wartość 'page' oznacza, że filter_results zawęża okno, a nie cały zbiór."
      +}
    • addedOutput schema / $defs / SetScope
      Added value: +{
      +  "description": "Whether a stored result set is the whole answer or a window into it.",
      +  "enum": [
      +    "complete",
      +    "page"
      +  ],
      +  "title": "SetScope",
      +  "type": "string"
      +}
  3. Changed23 schema fields changedv3.1.0
    • addedInput schema / properties / act_type / title
      Added value: +"Act Type"
    • addedInput schema / properties / date_from / title
      Added value: +"Date From"
    • addedInput schema / properties / date_to / title
      Added value: +"Date To"
    • addedInput schema / properties / detail_level / title
      Added value: +"Detail Level"
    • addedInput schema / properties / in_force / title
      Added value: +"In Force"
    • addedInput schema / properties / keywords / title
      Added value: +"Keywords"
    • changedInput schema / properties / limit / description
      Previous value: -"Maksymalna liczba wyników do zwrócenia. Domyślnie 20. Przydatne do ograniczenia dużych zbiorów."New value: +"Maksymalna liczba wyników do zwrócenia. Domyślnie 20. Przydatne do ograniczenia dużych zbiorów. Bez górnej granicy — w odróżnieniu od pozostałych narzędzi listujących, gdzie limit jest przycinany do 100."
    • addedInput schema / properties / limit / title
      Added value: +"Limit"
    • addedInput schema / properties / offset / title
      Added value: +"Offset"
    • addedInput schema / properties / pub_date_from / title
      Added value: +"Pub Date From"
    • addedInput schema / properties / pub_date_to / title
      Added value: +"Pub Date To"
    • addedInput schema / properties / publisher / title
      Added value: +"Publisher"
    • addedInput schema / properties / title / title
      Added value: +"Title"
    • addedInput schema / properties / year / title
      Added value: +"Year"
    • addedInput schema / title
      Added value: +"search_legal_actsArguments"
    • addedOutput schema / $defs
      Added value: +{
      +  "ActSummaryOutput": {
      +    "description": "Formatted output for act summary.",
      +    "properties": {
      +      "effective_date": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Effective Date"
      +      },
      +      "eli": {
      +        "title": "Eli",
      +        "type": "string"
      +      },
      +      "in_force": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "In Force"
      +      },
      +      "pos": {
      +        "title": "Pos",
      +        "type": "integer"
      +      },
      +      "promulgation_date": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Promulgation Date"
      +      },
      +      "publisher": {
      +        "title": "Publisher",
      +        "type": "string"
      +      },
      +      "status": {
      +        "title": "Status",
      +        "type": "string"
      +      },
      +      "title": {
      +        "title": "Title",
      +        "type": "string"
      +      },
      +      "type": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Type"
      +      },
      +      "year": {
      +        "title": "Year",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "eli",
      +      "publisher",
      +      "year",
      +      "pos",
      +      "title",
      +      "status"
      +    ],
      +    "title": "ActSummaryOutput",
      +    "type": "object"
      +  },
      +  "Hint": {
      +    "description": "Hint for next actions or related tools.",
      +    "properties": {
      +      "message": {
      +        "description": "Hint message",
      +        "title": "Message",
      +        "type": "string"
      +      },
      +      "parameters": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Suggested parameters",
      +        "title": "Parameters"
      +      },
      +      "tool": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Related tool name",
      +        "title": "Tool"
      +      }
      +    },
      +    "required": [
      +      "message"
      +    ],
      +    "title": "Hint",
      +    "type": "object"
      +  },
      +  "PageInfo": {
      +    "description": "Metadata describing one bounded response page.",
      +    "properties": {
      +      "limit": {
      +        "minimum": 0,
      +        "title": "Limit",
      +        "type": "integer"
      +      },
      +      "next_offset": {
      +        "anyOf": [
      +          {
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Next Offset"
      +      },
      +      "offset": {
      +        "minimum": 0,
      +        "title": "Offset",
      +        "type": "integer"
      +      },
      +      "returned_count": {
      +        "minimum": 0,
      +        "title": "Returned Count",
      +        "type": "integer"
      +      },
      +      "total_count": {
      +        "minimum": 0,
      +        "title": "Total Count",
      +        "type": "integer"
      +      },
      +      "unit": {
      +        "$ref": "#/$defs/PageUnit"
      +      },
      +      "was_truncated": {
      +        "title": "Was Truncated",
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "limit",
      +      "offset",
      +      "returned_count",
      +      "total_count",
      +      "was_truncated",
      +      "unit"
      +    ],
      +    "title": "PageInfo",
      +    "type": "object"
      +  },
      +  "PageUnit": {
      +    "description": "Unit represented by a page.",
      +    "enum": [
      +      "items",
      +      "characters"
      +    ],
      +    "title": "PageUnit",
      +    "type": "string"
      +  },
      +  "SearchOutput": {
      +    "description": "Output for search results.",
      +    "properties": {
      +      "page_info": {
      +        "$ref": "#/$defs/PageInfo"
      +      },
      +      "query_summary": {
      +        "title": "Query Summary",
      +        "type": "string"
      +      },
      +      "result_set_id": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Result Set Id"
      +      },
      +      "results": {
      +        "items": {
      +          "$ref": "#/$defs/ActSummaryOutput"
      +        },
      +        "title": "Results",
      +        "type": "array"
      +      },
      +      "returned_count": {
      +        "title": "Returned Count",
      +        "type": "integer"
      +      },
      +      "total_count": {
      +        "title": "Total Count",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "results",
      +      "total_count",
      +      "query_summary",
      +      "returned_count",
      +      "page_info"
      +    ],
      +    "title": "SearchOutput",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / data
      Added value: +{
      +  "$ref": "#/$defs/SearchOutput",
      +  "description": "The actual response data"
      +}
    • addedOutput schema / properties / hints
      Added value: +{
      +  "description": "Suggested next steps",
      +  "items": {
      +    "$ref": "#/$defs/Hint"
      +  },
      +  "title": "Hints",
      +  "type": "array"
      +}
    • addedOutput schema / properties / metadata
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Additional metadata",
      +  "title": "Metadata",
      +  "type": "object"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "type": "string"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "data"
      +]
    • addedOutput schema / title
      Added value: +"EnrichedResponse[SearchOutput]"
    • removedOutput schema / x-fastmcp-wrap-result
      Removed value: -true
  4. Changed19 schema fields changedv1.0.2
    • changedInput schema / properties / act_type / description
      Previous value: -"Document type (e.g., 'Rozporządzenie', 'Ustawa')"New value: +"Typ dokumentu (dokładne dopasowanie). Dostępne wartości: 'Ustawa', 'Rozporządzenie', 'Obwieszczenie', 'Komunikat', 'Uchwała', 'Zarządzenie', 'Wyrok', 'Postanowienie', 'Oświadczenie rządowe'. Użyj get_system_metadata(category='types') aby zobaczyć pełną listę."
    • changedInput schema / properties / date_from / description
      Previous value: -"Start date for effectiveness period (YYYY-MM-DD)"New value: +"Data wejścia w życie OD (YYYY-MM-DD). Filtruje akty które weszły w życie od tej daty."
    • changedInput schema / properties / date_to / description
      Previous value: -"End date for effectiveness period (YYYY-MM-DD)"New value: +"Data wejścia w życie DO (YYYY-MM-DD). Filtruje akty które weszły w życie do tej daty."
    • addedInput schema / properties / detail_level
      Added value: +{
      +  "default": "standard",
      +  "description": "Poziom szczegółowości wyników: 'minimal' (ELI, tytuł, status), 'standard' (+ typ, daty, obowiązywanie), 'full' (wszystkie pola). Domyślnie 'standard'.",
      +  "type": "string"
      +}
    • changedInput schema / properties / in_force / anyOf
      Previous value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / in_force / description
      Previous value: -"Only return currently active acts. Type 'true' for active, 'false' for inactive"New value: +"Filtruj po obowiązywaniu: true = tylko akty obecnie obowiązujące, false = tylko akty nieobowiązujące, None = wszystkie."
    • changedInput schema / properties / keywords / description
      Previous value: -"List of keywords to search in act content. ALL keywords must be present in the act (AND logic)"New value: +"Słowa kluczowe z systemu Sejmu (logika AND — wiele słów zawęża wyniki). Aby uzyskać logikę OR, wykonaj oddzielne wyszukiwanie dla każdego słowa. Użyj get_system_metadata(category='keywords') aby poznać dostępne słowa kluczowe."
    • changedInput schema / properties / limit / anyOf
      Previous value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results (default: all matching)"New value: +"Maksymalna liczba wyników do zwrócenia. Domyślnie 20. Przydatne do ograniczenia dużych zbiorów."
    • changedInput schema / properties / offset / anyOf
      Previous value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / offset / description
      Previous value: -"Skip first N results for pagination"New value: +"Liczba wyników do pominięcia (paginacja). Użyj z parametrem limit."
    • changedInput schema / properties / pub_date_from / description
      Previous value: -"Start date for publication period (YYYY-MM-DD)"New value: +"Data publikacji/ogłoszenia OD (YYYY-MM-DD). Filtruje po dacie ogłoszenia w dzienniku."
    • changedInput schema / properties / pub_date_to / description
      Previous value: -"End date for publication period (YYYY-MM-DD)"New value: +"Data publikacji/ogłoszenia DO (YYYY-MM-DD). Filtruje po dacie ogłoszenia w dzienniku."
    • addedInput schema / properties / publisher
      Added value: +{
      +  "default": "DU",
      +  "description": "Kod wydawcy: 'DU' (Dziennik Ustaw) lub 'MP' (Monitor Polski). Domyślnie 'DU'.",
      +  "type": "string"
      +}
    • changedInput schema / properties / title / description
      Previous value: -"Text fragment to search in act titles"New value: +"Szukaj w tytule aktu (dopasowanie podciągu). Np. 'budżet', 'przeciwpożarow', 'podatek dochodowy'."
    • changedInput schema / properties / year / anyOf
      Previous value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / year / description
      Previous value: -"Publication year (e.g., 2020, 2023)"New value: +"Rok publikacji (np. 2024)."
    • removedOutput schema / properties / result / items
      Removed value: -{}
    • changedOutput schema / properties / result / type
      Previous value: -"array"New value: +"string"
  5. Changed1 schema field changedv1.0.0
    • changedInput schema / properties / keywords / description
      Previous value: -"List of keywords to search in act content. ALL keywords must be present (AND logic)"New value: +"List of keywords to search in act content. ALL keywords must be present in the act (AND logic)"
  6. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnly, openWorld, idempotent, and non-destructive behavior. The description adds valuable behavioral context by warning that all keywords must match (AND logic) and explaining how to achieve OR logic by searching one word at a time. It does not contradict annotations and supplements them meaningfully.

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?

The description is well-structured with a clear opening, a critical keyword-logic notice, explicit usage boundaries, a follow-up workflow hint, and compact labeled examples. Every section serves a distinct purpose and the examples are formatted for quick parsing, so the length is justified.

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

Completeness5/5

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

For a tool with 13 optional parameters, the description covers the primary search semantics, the AND/OR behavior, when to avoid the tool, how to refine results with filter_results, and realistic parameter combinations. With an output schema present and full schema descriptions for parameters, there is no missing information an agent needs to invoke this tool correctly.

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?

Schema coverage is 100%, so the description is not required to document each parameter. However, it goes beyond the schema by providing seven concrete example calls that illustrate valid combinations of keywords, act_type, title, year, in_force, publisher, date ranges, pub_date ranges, and limit. This makes parameter semantics much more actionable than a bare schema.

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 opens with a specific verb and resource: 'Wyszukaj polskie akty prawne z Dziennika Ustaw (DU) i Monitora Polskiego (MP).' It clearly defines the tool as a search over legal acts and differentiates it from browsing an entire yearbook by explicitly routing that case to browse_acts. The wording is unambiguous and action-oriented.

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

Usage Guidelines5/5

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

The description provides explicit 'Kiedy użyć' and 'Kiedy NIE używać' guidance, including the exact alternative tool browse_acts for yearbook browsing. It also explains the follow-up use of filter_results(result_set_id=...) to narrow results, which helps an agent understand the intended workflow.

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