Skip to main content
Glama

tk-mcp

Serwer MCP dla orzecznictwa Trybunału Konstytucyjnego: wyszukiwarka wyroków i postanowień oraz pełny tekst orzeczenia. Źródło: oficjalna strona trybunal.gov.pl (HTML, bez auth).

Strona nie ma API - konektor czyta HTML. Wyszukiwarka to Solr (type=7383), pełny tekst czytamy z kontenera #content strony orzeczenia.

Instalacja

uv pip install -e ".[dev]"

Related MCP server: Constitutional-Court-decision-mcp

Narzędzia

Tool

Opis

search_judgments(query, page, sort, filter)

wyszukiwarka orzeczeń; count = globalna liczba trafień, items = jedna strona wyników

get_judgment_text(path)

pełny tekst orzeczenia (akapity z #content, bez PDF)

tk_coverage()

co konektor pokrywa, a czego nie (każda luka ma fallback)

Fasety (filter): signature:K|Kp|Kpt|P|Pp|SK|U, category:Wyrok, category:Postanowienie, modificationDate:today|lastWeek|lastMonth|lastYear|all. Sortowanie: publicationDate+desc / publicationDate+asc.

Uruchomienie

tk-mcp          # stdio
python -m tk_mcp.server

Rozwój

pytest
pytest -m smoke -v   # testy online (live trybunal.gov.pl)
ruff check

Audit log: ~/.matematic/audit/tk-mcp.jsonl (override: TK_MCP_AUDIT_DIR). Logowane są metadane wywołań (params_hash, result_summary, source_urls, latency_ms) - bez pełnych treści orzeczeń.

Uwagi o źródle

  • type=7383 jest obowiązkowy w wyszukiwarce - bez niego strona zwraca sam szkielet.

  • Brak trafień = count=0, nie błąd.

  • category:Publiczne ogłoszenie orzeczenia to faseta ogłoszeń (komunikatów), nie orzeczeń - dla realnych sygnatur zwraca 0.

  • Orzeczenia TK z lat 2024-2026 są częścią sporu ustrojowego: konektor zwraca treść verbatim i nie rozstrzyga o ważności ani prawidłowości składu.

Available Tools

3 tools
get_judgment_textA
Read-onlyIdempotent

Pelny tekst orzeczenia TK ze strony trybunal.gov.pl.

Parser scope'uje sie do kontenera #content (nav/naglowek emituja wlasne dlugie <p>), wiec zwrocone akapity to sklad orzekajacy i uzasadnienie, bez boilerplate. Bez PDF, bez JS.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNoURL, sciezka absolutna albo wzgledna, np "/postepowanie-i-orzeczenia/wyroki/art/4844-wiek-emerytalny-kobiet-i-mezczyzn"

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, openWorld, non-destructive), and the description usefully adds output-content behavior: it scopes to `#content` so boilerplate nav/header is excluded and only the adjudicating composition and justification are returned. It also discloses two real limitations ('no PDF, no JS') that constrain what pages will work.

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?

Front-loaded with purpose in the first sentence, followed by two tight clauses on parser scope and limitations. The parser-container detail is slightly implementation-flavored, but it justifies itself by explaining why the output is clean.

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?

With an output schema present and annotations carrying the safety profile, the description need only add what structured fields cannot: it explains the extraction scope and the PDF/JS limitations. The one gap is the absence of routing guidance relative to the sibling search and coverage tools.

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 coverage is 100% and the single `path` parameter is documented with a concrete example URL in the schema. The description adds nothing about accepted path formats or resolution, so the baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: fetching the full text ('Pelny tekst') of a TK judgment from trybunal.gov.pl. It is clearly distinguishable from search_judgments (retrieval vs discovery), though it never names or routes against its siblings explicitly.

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

Usage Guidelines2/5

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

The description explains parser behavior but never says when to use this tool versus search_judgments or tk_coverage, nor what input is expected (a URL/path obtained elsewhere). Usage is only inferable from the word 'full text'; there is no explicit when-to-use guidance.

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

search_judgmentsA
Read-onlyIdempotent

Szuka orzeczen TK w wyszukiwarce trybunal.gov.pl (Solr, type=7383).

Zwraca globalny count z naglowka i jedna strone wynikow. Brak naglowka licznika albo licznik 0 to count=0 z pustymi items - nie blad.

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNonumer strony, 1-based (default 1)
sortNo"publicationDate+desc" albo "publicationDate+asc"
queryNofraza pelnotekstowa (np "K 15/24", "emerytalny"). Pusta = przegladanie po samej `filter` (np. wszystkie wyroki), serwerowo `q=*:*`.
filterNofaseta, np "signature:K", "category:Wyrok", "modificationDate:lastYear"

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld/idempotent/non-destructive, so the bar is lower. The description still adds real value by disclosing result shape (global count header plus one page) and, importantly, the error semantics: missing counter header or zero counter yields count=0 with empty items rather than an error.

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?

Two short paragraphs, front-loaded with purpose then return/edge-case behavior. The internal detail (Solr, type=7383) is borderline noise but arguably useful for constructing filters, so it mostly earns its place.

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?

An output schema exists so return values need not be spelled out, yet the description still clarifies the count semantics and the empty-result case, which is exactly the gap an agent would hit when paginating. Nothing critical is missing for a search tool.

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 coverage is 100%, so the baseline is 3. The description adds a little beyond the schema by restating that an empty query falls back to q=*:* with filter-only browsing, but the meaning of page, sort and filter syntax is left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb (Szuka) and resource (orzeczenia TK) and even identifies the backend (trybunal.gov.pl, type=7383). It does not explicitly distinguish itself from get_judgment_text or tk_coverage, so the agent must infer the search-vs-fetch split.

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?

Implicit guidance is present: an empty query means browsing by filter alone (q=*:*), which tells the agent how to do a list-everything search. However there is no explicit statement of when to prefer this over get_judgment_text or tk_coverage.

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

tk_coverageA
Read-onlyIdempotent

Declare what this connector covers, how it is sourced, and what it does NOT cover.

Call this before telling a user that the Constitutional Tribunal record "does not contain" something, and whenever a search comes back empty: the absence may be a gap in this connector rather than in the TK record. Every gap carries a fallback saying where to look instead.

Returns: Coverage with families, an as-of note, and a non-empty list of known gaps.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
statusNo
familiesNo
as_of_noteYesStates what the dates mean, and what they do not promise.
known_gapsNoNever empty. An empty list would mean 'not checked', not 'no gaps'.

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered. The description adds real behavioral context beyond that: every gap carries a fallback saying where to look instead, and the result always includes a non-empty list of known gaps — semantics an agent cannot infer from the annotations alone.

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?

Structure is front-loaded: the imperative purpose first, then the usage condition, then the return summary. It is slightly longer than strictly necessary because the gap rationale is stated twice in adjacent sentences, but every element is relevant and there is no filler.

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?

With an output schema present, the description is not obligated to explain return values, yet it still names the Coverage payload, its families, as-of note, and non-empty gap list. Combined with the rich annotations and explicit call conditions, an agent has everything needed to invoke this 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?

The tool takes zero parameters, so there is nothing for the description to disambiguate; baseline 4 applies. The description correctly implies a parameterless invocation and spends no space on non-existent inputs.

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: 'Declare what this connector covers, how it is sourced, and what it does NOT cover.' That is unmistakably distinct from the sibling read tools (search_judgments, get_judgment_text), which fetch records rather than declare coverage metadata.

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?

It gives explicit trigger conditions: call before asserting the TK record 'does not contain' something, and whenever a search returns empty. It also explains why — an empty result may be a connector gap rather than a record gap — which directly routes the agent away from over-claiming based on sibling search results.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedget_judgment_text
    • First observedsearch_judgments
    • First observedtk_coverage

TDQS

A3.9/5.0

Scored across 3 tools

Disambiguation5/5

search_judgments (find judgments) and get_judgment_text (fetch full text of a known judgment) target clearly different actions, and tk_coverage is an explicit meta/coverage declaration tool that plays a distinct role. No overlap or plausible misselection.

Naming Consistency4/5

search_judgments and get_judgment_text follow a clean snake_case verb_noun pattern. tk_coverage breaks it by using a namespace prefix and no verb, but it is still readable and only a single deviation.

Tool Count4/5

Three tools is lean for a read-only judgment connector but each earns its place: search, retrieve, and a coverage/gap disclaimer. Slightly thin but well-scoped rather than padded.

Completeness4/5

The core read lifecycle (search then fetch full text) plus a coverage/gap declaration is covered for this domain. Minor gaps remain around pagination beyond one page and metadata-only listing, which the coverage tool at least documents.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Provides access to Polish court judgments from the SAOS database. Enables search and retrieval of judgments with full-text search, filtering, and detailed case information.
    3
    20 npm
    1
    Apache 2.0
  • A
    license
    A
    quality
    B
    maintenance
    Enables searching Polish parliamentary prints and retrieving the full legislative process history, including links to final legal acts, via the official Sejm API.
    3
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables access to Polish Constitutional Tribunal rulings, including search by keywords or case signature, listing recent decisions, and retrieving full judgment texts with metadata and official links. Supports section-wise and chunked retrieval of long documents to manage context budgets.
    4
    MIT