Skip to main content
Glama

filter_results

Filter and narrow down results from legal act searches using criteria such as document type, regex pattern, status, publication year, or date range. Requires a result_set_id; returns a new filtered set for iterative refinement.

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.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.
patternNoWzorzec regex do przeszukania pola (obsługuje OR: 'podatek|VAT|akcyza'). Wielkość liter jest ignorowana. Przykłady: 'zdrow|Minister Zdrowia|apteka|lekar', 'budżet.*państw', 'transport|drogow'
fieldNoPole do przeszukania wzorcem regex. Dostępne: 'title' (domyślne), 'eli', 'status', 'type', 'publisher'.title
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'
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'
year_equalsNoFiltruj po roku publikacji (dokładne dopasowanie). Np. 2024.
date_fieldNoPole daty do filtrowania zakresem: 'promulgation_date' (data ogłoszenia) lub 'effective_date' (data wejścia w życie).
date_fromNoPoczątek zakresu dat (YYYY-MM-DD). Wymaga ustawienia date_field.
date_toNoKoniec zakresu dat (YYYY-MM-DD). Wymaga ustawienia date_field.
sort_byNoPole do sortowania: 'title', 'year', 'pos', 'promulgation_date', 'effective_date', 'type', 'status'.
sort_descNoSortuj malejąco (True) lub rosnąco (False, domyślnie).
limitNoMaksymalna liczba wyników do zwrócenia.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries full burden. It explains that filtering creates a new result set (new result_set_id) without modifying the original, which is key behavioral context. However, it does not mention output format or potential performance implications, leaving minor gaps.

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 concise, well-structured with bullet points and clear sections (purpose, usage, examples). Every sentence adds value, and the examples illustrate typical use cases efficiently.

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 high parameter count and that an output schema exists, the description is fairly complete. It explains that a new result_set_id is generated and covers filtering options with examples. It misses a brief note on output schema but remains informative.

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% with all 12 parameters described. The description adds value beyond schema by providing regex examples, explaining OR logic and case insensitivity, and showing usage combinations. This extra context justifies a score above baseline 3.

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 identifies the tool as a filter for narrowing down results from earlier searches (search_legal_acts, browse_acts, track_legal_changes). It explicitly differentiates from siblings by stating it works on existing result sets, not performing new searches.

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 includes explicit 'Kiedy użyć' and 'Kiedy NIE używać' sections, directly telling when to use this tool versus others, with a named alternative (search_legal_acts). This fully addresses usage 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/numikel/law-scrapper-mcp'

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