Skip to main content
Glama

filter_results

Refine legal search results by applying filters like document type, date range, or text pattern to a previous result set. Returns a new set for further narrowing.

Instructions

Filtruj i zawężaj wyniki wcześniejszego wyszukiwania aktów prawnych.

Działa jak grep/filtr na wynikach z search_legal_acts, browse_acts lub track_legal_changes. Wymaga result_set_id zwróconego przez te narzędzia. Przefiltrowane wyniki zapisywane są jako nowy zestaw (nowe result_set_id), który można filtrować dalej.

Limit rozmiaru wejścia: pojedyncze wywołanie przetwarza maksymalnie 100 rekordów (wartość domyślna, konfigurowalna przez operatora). Większy zestaw kończy się błędem, a nie wynikiem częściowym — dzięki temu brak dopasowania zawsze oznacza przeszukanie całego zestawu. Zawęź wyszukiwanie przed filtrowaniem.

Kiedy użyć: Po search_legal_acts/browse_acts/track_legal_changes aby zawęzić wyniki. Kiedy NIE używać: Gdy potrzebujesz nowych wyników z API → użyj search_legal_acts.

Przykłady:

  • filter_results(result_set_id="rs_1", type_equals="Rozporządzenie") - Tylko rozporządzenia

  • filter_results(result_set_id="rs_1", pattern="zdrow|apteka|lekar") - Akty związane ze zdrowiem

  • filter_results(result_set_id="rs_1", pattern="podatek|VAT", type_equals="Ustawa") - Ustawy podatkowe

  • filter_results(result_set_id="rs_1", date_field="promulgation_date", date_from="2024-01-01", date_to="2024-06-30") - Ogłoszone w I połowie 2024

  • filter_results(result_set_id="rs_1", sort_by="promulgation_date", sort_desc=True, limit=10) - 10 najnowszych na pierwszej stronie

  • filter_results(result_set_id="rs_1", pattern="\p{L}+ o ochronie") - Wzorzec z klasą unikodową

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldNoPole do przeszukania wzorcem RE2. Dostępne: 'title' (domyślne), 'eli', 'status', 'type', 'publisher'.title
limitNoMaksymalna liczba wyników na stronie odpowiedzi (domyślnie 20, maks. 100).
offsetNoNieujemne przesunięcie strony wyników.
date_toNoKoniec zakresu dat (YYYY-MM-DD). Wymaga ustawienia date_field.
patternNoWzorzec wyszukiwania w składni RE2. Wielkość liter jest ignorowana. Obsługiwany podzbiór składni: alternatywa (a|b), klasy znaków ([a-z], \d, \p{L}, [[:alpha:]]), kwantyfikatory (*, +, ?, {n,m}; maksymalnie 4 zmienne zakresy), kotwice (^, $), grupy nieprzechwytujące. Lookaround ((?=...), (?<=...), (?!...)) oraz backreferencje (\1) nie są obsługiwane. Przykłady: 'zdrow|Minister Zdrowia|apteka|lekar', 'budżet.*państw', 'transport|drogow', '\p{L}+ o ochronie'
sort_byNoPole do sortowania: 'title', 'year', 'pos', 'promulgation_date', 'effective_date', 'type', 'status'.
date_fromNoPoczątek zakresu dat (YYYY-MM-DD). Wymaga ustawienia date_field.
sort_descNoSortuj malejąco (True) lub rosnąco (False, domyślnie).
date_fieldNoPole daty do filtrowania zakresem: 'promulgation_date' (data ogłoszenia) lub 'effective_date' (data wejścia w życie).
type_equalsNoFiltruj po typie dokumentu (dokładne dopasowanie). Wartości: 'Ustawa', 'Rozporządzenie', 'Obwieszczenie', 'Komunikat', 'Uchwała', 'Zarządzenie', 'Wyrok', 'Postanowienie', 'Oświadczenie rządowe'
year_equalsNoFiltruj po roku publikacji (dokładne dopasowanie). Np. 2024.
result_set_idYesIdentyfikator zestawu wyników z poprzedniego wyszukiwania (np. 'rs_1'). Zwracany przez search_legal_acts, browse_acts lub track_legal_changes w polu result_set_id.
status_equalsNoFiltruj po statusie aktu (dokładne dopasowanie). Wartości: 'akt obowiązujący', 'akt uchylony', 'akt jednorazowy', 'obowiązujący', 'uchylony', 'uznany za uchylony', 'nieobowiązujący'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe actual response data
hintsNoSuggested next steps
metadataNoAdditional metadata
Behavior4/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 discloses the 100-record input limit, the behavior on exceeding that limit (error, not partial results), and the implication for filtering semantics. It also notes that results are stored as a new set for further filtering. This goes beyond a simple description, though it doesn't mention all potential side effects or output details.

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

Conciseness4/5

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

The description is well-structured with concise paragraphs and examples. It front-loads the core purpose, then provides usage guidance and examples. Each section earns its place; the 'Kiedy użyć' sections and examples are particularly useful. Not a 5 because it could be slightly tightened, but it's efficient and well-organized.

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?

Complex tool with 13 parameters and an output schema. The description covers when to use, the prerequisite, behavior on limit, and provides numerous examples covering patterns, type filtering, dates, and sorting. Since an output schema exists, return values are not described, but the description is complete for calling the tool correctly. This likely ranks in Tier A for its thoroughness.

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%, with each parameter having a description. The tool description adds value by providing parameter usage examples (several rich combinations) and explaining the input limit. However, most parameter info is already in the schema, so the description adds marginal value. Baseline 3 is appropriate; the examples and limit info nudge it slightly positive but not to 4.

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 tool filters and narrows results from earlier legal act searches, acting as a grep/filter on results from search_legal_acts, browse_acts, or track_legal_changes. It distinguishes itself by explicitly naming the sibling tools and explaining it operates on previously returned result sets, making its purpose unmistakable.

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?

Provides explicit 'Kiedy użyć' (when to use) and 'Kiedy NIE używać' (when not to use) sections, stating to use after search_legal_acts/browse_acts/track_legal_changes and not when needing new results. It also explains the required result_set_id prerequisite, giving thorough usage guidance. However, it doesn't mention other filtering alternatives like list_result_sets, but that's a minor omission given the core alternatives are covered.

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