Skip to main content
Glama

Dayanak

v2.0.1 — 11 core + 36 extended MCP tools (47 total) · 152 CLI commands · 80 test files · 48 source modules

CI DOI

Proje sayfası: avfatihsozer.com/projeler/dayanak · English: README.en.md

Resmî ve kamuya açık Türk hukuk kaynaklarında (emsal kararlar ve mevzuat) citation-safe arama, araştırma ve belge hazırlık için MCP sunucusu.

Projenin eski adı emsal-mcp'dir; 2.0.0 sürümüyle Dayanak oldu. Eski emsal-mcp paketi artık dayanak'ı kurar, eski EMSAL_* ortam değişkenleri ve ~/.emsal_mcp veri dizini okunmaya devam eder.

İki şekilde çalışır:

  • Yerel korpus — 11,1 milyon karar ve güncel mevzuatın tamamı tek bir SQLite dosyasında; FTS5 tam metin + FAISS anlamsal arama. Ağ gerekmez.

  • Canlı kaynaklar — Bedesten/Yargıtay, AYM, Danıştay, Uyuşmazlık, Rekabet, Sayıştay, GİB, mevzuat.gov.tr, Resmî Gazete, KVKK adaptörleri.

Kırmızı çizgiler

  • Karar, metadata, tarih, esas/karar no, daire, atıf veya kanun maddesi uydurulmaz.

  • full_text / html_markdown içeriği olmayan belgeler quote/draft için kullanılmaz.

  • quoteUsable ve draftUsable sadece tam metin/HTML markdown varsa true olur.

  • Rate-limit bilinçli olarak muhafazakâr değildir; tek kullanıcı/tek bilgisayar hedeflenmiştir.

Related MCP server: Hukuk MCP

Korpus

Ölçüm tarihi 16 Eylül 2026, canlı korpus (cache.sqlite3, 72 GB).

Katman

Ölçü

Kararlar

11.108.242 belge (documents_v2). Taban: HF hamzabagirsakci/turkish-court-decisions (11.045.085, CC0), üstüne günlük Bedesten crawl'ı.

Mevzuat belgeleri

14.298 kayıt / 14.171 güncel sürüm: 916 kanun, 63 KHK, 33 CBK, 8.840 yönetmelik (8.830 güncel), 4.446 tebliğ (4.329 güncel)

Mevzuat maddeleri

303.454 madde, 96.186 değişiklik kaydı

Karar anlamsal indeksi

29.554.075 parça vektörü — intfloat/multilingual-e5-small (384 boyut), FAISS IVF16384,PQ64 + fp16 sidecar refine, nprobe=128, chunking v2

Mevzuat anlamsal indeksi

423.920 parça vektörü (303.454 maddeden), aynı model ve indeks tipi

Ayrıntı ve ölçümler: docs/BULK_INDEX.md.

Kurulum

Hızlı kurulum (korpussuz)

Dayanak, 11 milyon kararlık yerel korpus olmadan da çalışır. Bu durumda karar ve mevzuat aramaları resmî kaynaklardan (Bedesten, mevzuat.gov.tr, AYM, Danıştay ve diğerleri) canlı yapılır, kararın tam metni de canlı getirilir. Yalnız yerel korpusta arayan araçlar (search_local_corpus, mevzuat_korpus_ara, mevzuat_madde_getir) boş sonuç döndürür ve canlı araca yönlendirir. Python 3.11 ya da üstü gerekir.

# Kurmadan doğrudan çalıştırmak için (uv gerekir)
uvx --from dayanak dayanak-server

# ya da kalıcı kurulum
pipx install dayanak

Claude Code'a eklemek için:

claude mcp add dayanak -- uvx --from dayanak dayanak-server

Claude Desktop ya da başka bir MCP istemcisi için yapılandırma:

{
  "mcpServers": {
    "dayanak": {
      "command": "uvx",
      "args": ["--from", "dayanak", "dayanak-server"]
    }
  }
}

Varsayılan araç profili 11 temel araçtır; tamamı için DAYANAK_TOOL_PROFILE=full ortam değişkenini verin. Çekilen belgeler ~/.dayanak/cache.sqlite3 dosyasında önbelleğe alınır (DAYANAK_CACHE_PATH ile değişir).

Geliştirme kurulumu (korpusla)

# Windows
cd <repo-dizini>
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev,mcp,embeddings]"

# macOS / Linux
cd <repo-dizini>
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,mcp,embeddings]"

dayanak version

Anlamsal aramanın toplu FAISS indeksini kullanabilmesi için ayrıca pip install faiss-cpu gerekir. Ayrıntılı kurulum: INSTALL.md.

Çalıştırma

HTTP (streamable-http) sunucusu

Canlı kurulumda sunucu scripts\mcp_http_sunucu.cmd ile başlar; bu betik ortam değişkenlerini kendi içinde kurar ve logu %LOCALAPPDATA%\dayanak\mcp_http.log dosyasına yazar.

.\scripts\mcp_http_sunucu.cmd

Windows'ta EmsalMcpHttp zamanlanmış görevi aynı betiği oturum açılışında çalıştırır. Uç nokta: http://<host>:<port>/mcp.

stdio sunucusu

call .\scripts\dayanak-env.cmd
dayanak-server

Ortam değişkenleri

Değişken

Ne işe yarar

Örnek değer

DAYANAK_CACHE_PATH

Korpus SQLite dosyası

<veri-dizini>\cache.sqlite3

DAYANAK_BULK_VEC_DIR

fp16 vektör sidecar'ları (refine için)

<bench-dizini>\vec

DAYANAK_EMBEDDING_PROVIDER

Gömme sağlayıcısı

fastembed-multilingual-e5

DAYANAK_EMBEDDING_CACHE_DIR

ONNX model önbelleği

<veri-dizini>\models\fastembed

DAYANAK_MCP_TRANSPORT

stdio (varsayılan) veya streamable-http

streamable-http

DAYANAK_MCP_HOST / DAYANAK_MCP_PORT

HTTP dinleme adresi

127.0.0.1 / 8790

DAYANAK_TOOL_PROFILE

core (varsayılan) veya full

core

DAYANAK_TOOL_THREADS

Sync araçları için thread havuzu (0 = kapalı)

6

DAYANAK_TOOL_TIMEOUT

Araç başına saniye sınırı

180

Tek seferlik CLI çağrıları için scripts\dayanak-env.cmd aynı değişkenleri kurar (call .\scripts\dayanak-env.cmd && .venv\Scripts\dayanak ...).

Makineye özel değerler (veri dizini, dinleme adresi, yedek hedefi) repoda tutulmaz: scripts\yerel-ayar.ornek.cmd dosyasını scripts\yerel-ayar.cmd adıyla kopyalayıp doldurun (.gitignore'dadır). dayanak-env.cmd, crawl_incremental.ps1 ve Python betikleri (scripts/_yollar.py) bu dosyayı okur; boş bırakılan her yol ~/.dayanak altından türetilir.

MCP araçları

Varsayılan profil core — 11 araç kayıtlı gelir. Geri kalanı çalışan sunucuya load_extended_tools ile kategori kategori eklenir. Sözleşmeler: docs/MCP_CONTRACTS.md.

Core (11):

Araç

Ne yapar

search_decisions

Canlı kaynaklarda karar araması (yönlendirme dahil)

get_document

Tek belge getirme

search_local_corpus

Yerel 11 M karar korpusunda FTS5 + anlamsal arama

search_legislation

mevzuat.gov.tr üzerinde mevzuat araması

get_legislation

Mevzuat metni / madde getirme

mevzuat_korpus_ara

Yerel mevzuat korpusunda madde bazlı arama

mevzuat_madde_getir

Yerel korpustan tek madde

research_topic

Konu araştırması paketi (bundle + kalite panosu)

export_document

Belge dışa aktarma

load_extended_tools

Extended kategorileri çalışırken yükleme

health_check

Kaynak/breaker/indeks/zamanlanmış iş sağlığı

Extended (36), kategori bazında:

Kategori

Araç sayısı

Araçlar

legislation

1

mevzuat_degisiklik_raporu

drafting

2

citation_check, prepare_petition

files

1

read_legal_file

meta

2

list_sources, legal_research_guide

health_admin

4

circuit_breaker_status, source_health, source_smoke, check_government_servers_health

watch

4

watch_add, watch_list, watch_run, watch_remove

privacy

3

privacy_scan, privacy_redact, privacy_audit

chambers

4

chamber_overview, profile_chamber, chamber_timeline, find_similar_chambers

indexing

1

index_status

drafting_advanced

10

draft_document, export_bundle, inspect_petition_pack, build_multi_issue_pack, inspect_multi_issue_pack, list_petition_templates, get_petition_template, build_argument_chain, score_argument, get_argument_strength_report

udf_admin

4

udf_toolkit_status, udf_authoring_instructions, pdf_toolkit_status, promote_pdf_to_full_text

Core profilin docstring bütçesi (20.000 karakter) dolduğu için citation_check, prepare_petition, read_legal_file, list_sources ve legal_research_guide 6 Eylül 2026'da extended'a alındı; load_extended_tools ile geri gelirler.

CLI örnekleri

dayanak sources
dayanak search bedesten "muvazaa" --limit 5
dayanak get bedesten DOCUMENT_ID
dayanak semantic bulk-status
dayanak mevzuat korpus-ara "tahliye taahhüdü"
dayanak smoke --offline

Korpus crawl + panel

Uzun soluklu korpus taraması (Bedesten'den yıl yıl karar indirme) bir master script ile yürür, durumu tarayıcıdan izlenir.

.\scripts\kur-otomatik-baslatma.ps1          # oturum açılışına ekler (yönetici gerekmez)
.\scripts\kur-otomatik-baslatma.ps1 -Durum   # ne çalışıyor?
.\scripts\kur-otomatik-baslatma.ps1 -Kaldir  # geri al

Parça

Ne yapar

crawl_master.ps1

Yılları sırayla tarar. Tek örnek kilidi (mutex), crawl_logs\crawl_state.json'a checkpoint yazar — PC kapanırsa kaldığı yıl ve sayfadan devam eder.

scripts\panel.py

http://127.0.0.1:8799 — canlı crawl durumu, yıl hedefleri, kütüphane dağılımı, hız/tahmin. Ek bağımlılık yok.

Zamanlanmış görevler

EmsalCrawlMaster (oturum + 1 dk), EmsalPanel (oturum + 20 sn).

Notlar:

  • Rate limit DAYANAK_RATE_LIMIT_MAX=12. Ölçüldü: 12'de 429 yok (~2.800 belge/saat), 15'te 429 cooldown döngüsüne girip hız sıfırlanıyor.

  • Panel, cache.sqlite3 üzerinde yıl sayımı yapmaz — tek bir yıl sorgusu tam tablo taraması yüzünden ~60 sn sürüyor. Sayımlar ~/.dayanak/panel_stats.sqlite3 içinde artımlı (yalnız yeni rowid'ler) tutulur, günde bir kez tam sayım yapılır.

  • Yıl hedefleri Bedesten'in total alanından ölçülür (crawl_logs\hedefler.json), tahmin edilmez.

İşletim

Zamanlanmış işler (Windows Görev Zamanlayıcı, korpus sunucusu):

Görev

Zaman

Betik

Ne yapar

EmsalMcpHttp

oturum açılışı

scripts\mcp_http_sunucu.cmd

MCP sunucusunu yayınlar

EmsalCrawlDaily

her gün 04:30

scripts\crawl_incremental.ps1

Artımlı karar crawl'ı

EmsalMevzuatWeekly

Pazar 03:00

scripts\mevzuat_weekly.cmd

Mevzuat güncellemesi (+ art-işlem mevzuat_semantic.cmd)

EmsalMonthlyMerge

ayın 1'i 02:00

scripts\monthly_merge.cmd

Delta vektörlerini toplu FAISS indeksine katar

health_check aracı bu işlerin son koşusunu scheduled_jobs bloğunda raporlar: schtasks çağırmaz, işlerin kendi log dosyalarına yazdığı bitiş işaretini ve dosya zaman damgasını okur. Bir iş gecikmişse ya da rc != 0 ile bitmişse overall "degraded" döner (src/dayanak/ops_status.py). Aynı çıktıda tool_runtime bloğu thread havuzu / zaman aşımı sayaçlarını verir; runaway > 0 ise sunucu yeniden başlatılmalıdır.

Belgeler

Belge

İçerik

docs/BULK_INDEX.md

Toplu korpus kurulumu, FAISS indeks yapısı, chunking v2, ölçümler, tuzaklar

docs/MCP_CONTRACTS.md

MCP araç sözleşmeleri, profiller, kategoriler

docs/COOKBOOK.md

Kopyala-çalıştır iş akışı reçeteleri

docs/JSON_CONTRACTS.md

Genel API fonksiyonlarının JSON çıktı sözleşmeleri

docs/ERROR_CATALOG.md

Hata kodları ve önerilen eylemler

docs/INDEX.md

Tüm belgelerin dizini

CHANGELOG.md

Sürüm geçmişi

Test

.venv\Scripts\python.exe -X utf8 -m pytest tests -q
ruff check src tests scripts

Canlı kaynağa giden testler varsayılan olarak atlanır; açmak için DAYANAK_LIVE_TESTS=1.

Lisans

GNU Affero Genel Kamu Lisansı sürüm 3 ile lisanslanmıştır (AGPL-3.0-only); tam metin LICENSE dosyasındadır. Yazılımı değiştirip ağ üzerinden başkalarına hizmet olarak sunarsanız, değiştirdiğiniz kaynak kodu da o kullanıcılara aynı lisansla sunmanız gerekir. Güvenlik açıklarının nasıl bildirileceği SECURITY.md dosyasında anlatılıyor.

Telif hakkı © 2026 Alpaslan Fatih Sözer

Available Tools

11 tools
export_documentA

Unified document export: DOCX, UDF, PDF, plain text, or bundle.

Args: format: 'docx' (default), 'udf', 'pdf', 'plain', 'bundle', or 'capabilities' (returns supported formats). draft_path: Path to draft.md (for docx/plain). draft_json: Draft metadata dict (for docx). text: Text to write (for udf; plain text — petition formatting such as bold title/labels/headings is applied automatically). out_path: Output file path (for docx/udf/plain). out_dir: Output directory (for bundle). pack_dir: Pack directory (for bundle). draft_dir: Draft output directory (for bundle). docx_path: Path to a .docx (for bundle; for udf this is the PREFERRED input — converts DOCX directly to UDF preserving bold, alignment, indent and line spacing). udf_path: Path to a .udf — converts it to docx or pdf via LibreOffice (replaces convert_udf_to_docx/pdf). title_centered: Center the title in UDF output. title: Document title (for legacy export_bundle). body: Document body (for legacy export_bundle). documents: List of document dicts (for legacy export_bundle).

NameRequiredDescriptionDefault
bodyNo
textNo
titleNo
formatNodocx
out_dirNo
out_pathNo
pack_dirNo
udf_pathNo
documentsNo
docx_pathNo
draft_dirNo
draft_jsonNo
draft_pathNo
title_centeredNo

TDQS

A4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It usefully discloses non-obvious behavior – plain-text petition formatting applied automatically, docx_path being the PREFERRED udf input, LibreOffice-based conversion preserving bold/alignment/indent/spacing – but says nothing about overwrite semantics for out_path, error behavior, or required runtime dependencies.

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?

One-line summary front-loads purpose, followed by a per-parameter list that earns its length for a 14-param tool. Dense but readable; no filler sentences.

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

Completeness3/5

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

For a 14-parameter, multi-mode tool with no annotations, no output schema, and no required-param declaration, the description omits two things an agent needs: which parameters are actually required for each format mode, and what the tool returns (a path? a structure?) besides the 'capabilities' hint.

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 0% and there are 14 parameters, so the description is doing all the work: nearly every parameter is annotated with the format it applies to and its role. A few units remain thin (draft_json as an opaque 'metadata dict', title/body/documents tagged only 'legacy export_bundle'), but compensation is strong overall.

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 opening line states a specific verb+resource ('Unified document export') and enumerates the five formats plus a capabilities mode, so the agent can distinguish it immediately from the search/get siblings.

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

Usage Guidelines4/5

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

It routes the caller per format by tying each parameter to the format it serves (draft_path for docx/plain, out_dir for bundle, etc.) and explicitly notes udf_path 'replaces convert_udf_to_docx/pdf'. It stops short of stating when NOT to use this tool or which parameter combinations are mandatory per format.

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

get_documentA

Fetch a single document by ID from the given source.

Args: source: Source identifier. document_id: Document ID (must not be empty). include_raw: If True, include the raw upstream response in the output (debugging). Default: False (deduplicated output with single markdown text field). page_number: 1-indexed page number for long documents (>= 40 000 chars). Default 1 returns the first page. Long documents are split at paragraph boundaries so no page starts or ends mid-paragraph.

Returns: Document dict with deduplicated metadata and content fields. Text is served as a single markdown field; full_text, raw, and metadata.content are omitted by default.

For long documents (>= 40 000 chars), the response includes
``current_page``, ``total_pages``, and ``total_chars`` so the
agent can request subsequent pages via ``page_number``.
NameRequiredDescriptionDefault
sourceYes
document_idYes
include_rawNo
page_numberNo

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses output deduplication (full_text, raw, metadata.content omitted by default), the 40,000-char pagination threshold, paragraph-boundary splitting, and the pagination fields returned. It does not state that the operation is read-only, nor any auth/rate-limit or missing-document error behavior, which keeps it from a 5.

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 one-line summary followed by clearly labeled Args and Returns blocks; every sentence adds usable information at 0% schema coverage. The Returns section restates the deduplication rule already implied by include_raw, which is minor redundancy but not enough to hurt.

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?

There is no output schema, so describing the return shape (markdown field, current_page/total_pages/total_chars) is necessary and present; the pagination contract is fully explained. Missing pieces are error/not-found behavior and an explicit read-only guarantee, which an agent would reasonably want for a fetch tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must document all four parameters, and it does: source as identifier, document_id 'must not be empty', include_raw with default and debugging rationale, and page_number as 1-indexed with default 1 plus the threshold that activates it. This fully compensates for the bare 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?

States a specific verb and resource with explicit scope: 'Fetch a single document by ID from the given source.' That distinguishes it by implication from the search tools (search_decisions, search_legislation) and from get_legislation, since retrieval is keyed by ID. It never names an alternative explicitly, so it falls short of a 5.

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?

Usage is only implied: 'by ID from the given source' suggests this is the fetch stage after a search, and 'include_raw ... (debugging)' hints at a debug use case. There is no statement of when to prefer this over get_legislation or search_local_corpus, and no preconditions (e.g., the ID must come from a prior search).

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

get_legislationA

Get legislation content from the Mevzuat source.

Args: document_id: Mevzuat document ID. source: Source ID (default: "mevzuat"). part: 'document' (default, full text), 'article_tree' the part/section/article tree, 'gerekce' the rationale. page_number: page of part='document' (40 000 chars/page).

Returns: Dict for the requested part; 'document' also carries current_page/total_pages/total_chars.

NameRequiredDescriptionDefault
partNodocument
sourceNo
document_idYes
page_numberNo

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It does disclose useful behavior: the pagination model (40,000 chars/page) and the return shape including current_page/total_pages/total_chars. It omits auth requirements, error behavior, and an explicit read-only statement (only implied by 'Get'), leaving meaningful gaps for a no-annotation tool.

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 docstring-style layout is front-loaded with the purpose, then Args, then Returns, with no filler sentences. It is appropriately sized for a four-parameter tool, though the Returns section is terse and could be marginally clearer.

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?

There is no output schema, but the description compensates by describing the returned Dict per part and the pagination fields. Combined with full parameter coverage, an agent has enough to invoke it correctly; only auth/error context is missing.

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 description coverage is 0%, so the description must compensate, and it largely does: it documents all four parameters, including document_id, source, the three valid 'part' values, and page_number with its page size. A minor inconsistency exists where the description says source defaults to 'mevzuat' while the schema default is null.

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 description states a specific verb and resource ('Get legislation content from the Mevzuat source') and enumerates the retrieval modes ('document', 'article_tree', 'gerekce'), so the agent knows exactly what it returns. It does not, however, differentiate itself from siblings like search_legislation, get_document, or mevzuat_madde_getir, so it falls short of a 5.

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?

Usage is implied through the 'part' modes: the agent can infer to use 'document' for full text, 'article_tree' for structure, and 'gerekce' for rationale. There is no explicit guidance on when to choose this tool over the sibling search/get tools, nor any stated prerequisites, so it remains implied rather than explicit.

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

health_checkA

Run a consolidated health check across sources, breakers, indexes and cron jobs.

Returns overall status plus source smoke summary, circuit breaker states, search index status and scheduled_jobs — the last run of the daily crawl, weekly legislation update, monthly merge and the legislation semantic index (read from their log files). overall is "degraded" when a job is late or ended with rc != 0.

NameRequiredDescriptionDefault

No parameters

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it enumerates what is checked (source smoke, breakers, indexes, cron jobs), explains that scheduled_jobs is read from log files, and defines the "degraded" condition (late job or rc != 0). It omits any statement of read-only safety, permissions, or latency, which keeps it short of a 5.

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?

Purpose is front-loaded in the first sentence, with return-value detail following in a logical order. It is appropriately sized for a no-arg diagnostic, though the enumerated job list is slightly dense.

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?

There is no output schema, so the description must document return values, and it does: overall status, source smoke summary, breaker states, index status, and scheduled_jobs semantics including the degraded rule. With no parameters and a read-only-seeming operation, the remaining gap (safety/permissions profile) is small.

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 to disambiguate; baseline 4 applies. The description correctly implies no input is required.

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?

Opens with a specific verb and resource scope: "Run a consolidated health check across sources, breakers, indexes and cron jobs." This clearly distinguishes it from every sibling (all search/get/retrieval tools), so an agent can identify it as the operational diagnostic without opening the schema.

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?

Usage is implied by the diagnostic framing, but there is no explicit when-to-use guidance, no statement of when-not to use it, and no alternatives named (none of the siblings are close substitutes, so this is a minor gap). A caller can infer it is a monitoring entry point but is given no trigger conditions.

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

load_extended_toolsA

Load extra tool categories into the running MCP server (no restart).

Core profile registers 11 tools. Everything else waits here; load a category when the task needs it.

Categories: drafting — citation_check (atif dogrula/bicimlendir/guvenlik), prepare_petition (dilekce input_pack/outline/taslak) files — read_legal_file (UDF/PDF dosyasi oku) meta — list_sources (kaynaklar, birim kodlari, mevzuat turleri), legal_research_guide (arama/Solr/daire/atif rehberi) legislation — mevzuat_degisiklik_raporu (haftalik mevzuat degisimi) drafting_advanced — coklu-mesele paketi, sablonlar, argüman zinciri, draft_document, export_bundle chambers — daire profili, timeline, benzer daire privacy — PII tarama/maskeleme/denetim watch — arastirma izleme listeleri indexing — index_status (semantik indeks durumu) health_admin — circuit breaker, kaynak sagligi/smoke udf_admin — UDF/PDF araci durumu, PDF tam metne yukseltme

Args: categories: List of category names, e.g. ["drafting", "files"].

Returns: Dict with ok, loaded tools, already_loaded, invalid_categories, and a note if the MCP client may need to refresh its tool list.

NameRequiredDescriptionDefault
categoriesYes

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely does so: it discloses the no-restart behavior, the return fields (ok, loaded, already_loaded, invalid_categories), and the non-obvious caveat that the MCP client may need to refresh its tool list. It stops short of saying whether repeated loads are idempotent or what the cost/limits of loading are.

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 the core action and the no-restart constraint, then a scannable category list. The embedded sub-tool descriptions add length, but they earn their place by previewing what each category unlocks; only minor tidying is warranted.

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?

No output schema exists, so the description correctly supplies a Returns section, and it lists the full category vocabulary. For a meta-tool with one parameter this is close to sufficient; only failure/edge behavior (e.g., what invalid categories do) is left implicit.

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 description coverage is 0% and the schema provides no enum, so the description is the only source of valid values, and it enumerates all category names with examples like ["drafting", "files"]. The sub-tool glosses are useful but occasionally muddy, mixing Turkish labels, which slightly weakens the mapping of names to categories.

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?

States a specific verb and resource ('Load extra tool categories into the running MCP server') plus the key constraint 'no restart'. This clearly distinguishes it from all sibling legal-research tools, which retrieve content rather than mutate the server's tool surface.

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

Usage Guidelines4/5

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

Gives explicit context: 'Core profile registers 11 tools. Everything else waits here; load a category when the task needs it.' This tells the agent exactly when to reach for it. It lacks an explicit when-not clause (e.g., what to do if a category is already loaded), which keeps it short of a 5.

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

mevzuat_korpus_araA

YEREL korpusta MADDE bazında arama (çevrimdışı, madde metinlerinde).

mode: "hybrid" (varsayılan; BM25+anlam RRF), "lexical" (FTS5, kelime AND), "semantic" (ifade metinde geçmese de bulur). 0 sonuç "hüküm yok" DEMEK DEĞİL: korpus yalnız çekilmişi içerir, search_legislation çağır. mevzuat_no tek mevzuatla sınırlar (ör. "6098"). Sonuç: mevzuat_adi, madde_no, baslik, snippet, kaynak_url.

NameRequiredDescriptionDefault
modeNohybrid
limitNo
queryYes
mevzuat_noNo

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it declares the offline/local nature, that the corpus only contains already-fetched documents, the different recall behavior of each mode, and the fields returned. It omits pagination/limit behavior and any auth context, keeping it from a 5.

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 the core purpose, then modes, then the critical false-negative caveat, then result shape. Dense but every clause carries information; the inline key:value layout reads slightly like notes rather than prose but wastes nothing.

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?

For a 4-parameter search tool with no output schema, the description supplies the mode semantics, the scope-limiter, the return fields, and the important operational caveat about empty results. What remains missing (limit/pagination, ranking details) is minor.

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 description coverage is 0%, so the description must compensate, and it does for the two non-obvious parameters: mode is given three named values with semantic explanations, and mevzuat_no is explained with a concrete example ('6098'). Only 'limit' is left implicit, which is a minor gap given the obvious default of 20.

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?

States a specific verb and resource ('YEREL korpusta MADDE bazında arama') and scopes it to offline, article-level search, which cleanly separates it from the remote sibling search_legislation. An agent can pick this tool without opening any schema.

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

Usage Guidelines4/5

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

Explicitly warns that 0 results does not mean 'no provision' and routes the agent to search_legislation, and it explains when to pick each mode (lexical vs semantic vs hybrid). It lacks an explicit statement of the positive condition for using this local tool over the remote one, so it falls just short of 5.

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

mevzuat_madde_getirA

Yerel korpustan tek maddenin TAM metni (çevrimdışı).

madde_no "390", "12/A", "Geçici 1" kabul eder. Korpusta yoksa NOT_FOUND döner — uydurma, canlı get_legislation çağır.

NameRequiredDescriptionDefault
madde_noYes
mevzuat_noYes

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses the offline nature and the NOT_FOUND failure mode with an anti-hallucination warning, but says nothing about permissions, response shape, or whether the corpus can be stale.

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?

Three short sentences, front-loaded with the core action and scope, then format examples, then failure handling. No filler; every clause 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?

For a two-parameter lookup with no output schema or annotations, the description covers what is returned (full article text), the offline source, accepted input formats, and the failure mode. The only real gap is the meaning/format of mevzuat_no.

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 0%, so the description must compensate. It does give concrete accepted formats for madde_no ("390", "12/A", "Geçici 1"), which is genuinely useful, but leaves mevzuat_no completely unexplained.

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?

States a specific verb and resource: retrieving the FULL text of a single article from the local (offline) corpus. It implicitly distinguishes itself from get_legislation by framing this as the offline source, so an agent can tell them apart.

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

Usage Guidelines4/5

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

Explicitly routes the agent to the live alternative: if the article is not in the corpus, it returns NOT_FOUND and the agent should call get_legislation instead of fabricating. This is clear fallback guidance, though it does not spell out upfront when to prefer this tool over the live one in the normal case.

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

research_topicC

Search sources, fetch documents, and build a research bundle.

Returns bundle metadata with query, sources, result_count, fetched_count, content_status_summary, citation_safe_count, generated_files, warnings, and recommended_next_steps.

NameRequiredDescriptionDefault
queryYes
filtersNo
sourcesNo
output_dirNo
fetch_countNo

TDQS

C2.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully enumerates the return payload (citation_safe_count, warnings, recommended_next_steps), signaling quality/citation concerns, but omits side effects like where generated_files are written, whether output_dir is required for file generation, and any rate limits or permissions.

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 sentences, front-loaded with the action and followed by the return contract. Efficiently sized, though the field enumeration is dense prose that would read better as a list.

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

Completeness2/5

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

For a 5-parameter composite tool with no output schema and no annotations, the description leaves the parameter contract and side effects largely unexplained. Enumerating return fields helps but does not cover how to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and none of the 5 parameters (filters, sources, output_dir, fetch_count) are explained in the description. 'query' appears only implicitly inside the return-field list. With low coverage the description should compensate but does not.

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 compound purpose: 'Search sources, fetch documents, and build a research bundle.' The verb+resource is clear, but the compound nature makes it hard to distinguish from siblings like search_local_corpus or search_decisions when only the search portion is needed; no sibling is named.

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?

No when-to-use guidance, no prerequisites, and no mention of alternatives among the 10 sibling search/get tools. The agent must infer whether this is the right entry point versus narrower search tools.

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

search_decisionsA

✅ PRIMARY, MANDATORY TOOL FOR ALL CASE-LAW / DECISION / MEVZUAT RESEARCH.

For ANY question about court decisions, precedents, case law, or legislation you MUST call THIS tool first. It is the ONLY tool that retrieves real, current documents LIVE from the official source (online — e.g. Bedesten/Yargıtay, Mevzuat).

HARD RULES — no exceptions, no interpretation:

  • Do NOT answer case-law questions from memory, training data, or web search.

  • Do NOT use search_local_corpus to FIND decisions — it searches ONLY the local corpus and cannot discover anything not fetched here first.

  • Every esas/karar number, date, and chamber you cite MUST come from a document returned by THIS tool and verified via get_document full text.

  • If you have not called this tool yet, you have NO case law to cite.

--- QUERY HYGIENE (CRITICAL) ---

  • Do NOT paste the user's question in. Solr matches tokens, not natural language. Reduce it to 2–5 legal keywords: "işçi alacağı zamanaşımı" ✓, not "işçinin fazla mesai ve kıdem tazminatı konusunda zamanaşımı süresi".

  • Preserve Turkish diacritics exactly; stripping them silently drops matches. "kararı" ✓ not "karari" ✗.

--- BEDESTEN SOLR OPERATOR COOKBOOK --- ⚠️ THE DEFAULT OPERATOR IS OR — whitespace between bare terms means UNION. tahliye taahhüdü geçerlilik matches ANY of the three words. To require all, prefix each with + or join with UPPERCASE AND.

+required must appear (+tazminat) -excluded must not (-bölge) "exact" phrase ("iş kazası") AND/OR/NOT UPPERCASE only (grouping) sub-expressions

⚠️ CHARACTER WHITELIST (measured live): Bedesten accepts ONLY letters, digits, spaces and the operators above. Wildcards (* ?), fuzzy (~), boost (^) and ANY punctuation (/ . , ' : ; _ …) are rejected outright with INVALID_QUERY — there is NO wildcard search, write the full word. Article numbers: "83 a" not 83/a (the index stores 83/a as the two tokens 83 and a). The tool strips/converts such characters before sending (83/a → "83 a", maaş. → maaş) and reports it in warnings + query_sanitized; write them clean to avoid surprises.

⚠️ THE INDEX IS NOT STEMMED — each inflected form is its own token: +taahhüdü ≈ 16 700 hits vs +taahhüt ≈ 43 800. Prefer noun stems or quoted phrases, and keep the diacritics (+taahhut ≈ 10 hits).

TWO-PASS BEHAVIOUR: A plain multi-word query with NO operators is first tried with every term required (+t1 +t2 ...). If that pass cannot fill limit — normal for 3+ inflected terms on an unstemmed index — the ORIGINAL query re-runs as OR. Nothing is lost (OR is a superset, and Solr ranks multi-term matches higher). Reported in warnings and as fallback_to_or, so a starved AND pass never looks like "no precedent".

Worked examples (query string → what it does): +işçi +tazminat → BOTH "işçi" AND "tazminat" +"iş kazası" +tazminat → phrase "iş kazası" AND "tazminat" (+işçi OR +memur) +tazminat -manevi → (işçi OR memur) AND tazminat, not "manevi"

⚠️ Quote each concept rather than listing bare inflected words: +"tahliye taahhüdü" +"adli tatil" ✓. A +-joined query returning 0 is a real finding about the phrasing — retry broader or with the stem, not with more terms.

Notes:

  • A single common term ("karar") returns noise; add a specific constraint.

  • At least ONE criterion is required (query, esas_no, karar_no, birimAdi, or a date range). court_types alone is rejected — it is a filter.

Args: source: Optional source identifier. Available sources: - 'bedesten' (default) — combined Yargıtay + Danıştay sweep - 'resmigazete' — Resmî Gazete. With query and NO single day (no date, or a karar_tarihi_start / karar_tarihi_end range) it searches the local TITLE index (2000-06-27 →, titles only, not full text; accent-insensitive, prefix match, "quoted phrase" ok) across all issues, paginated; sort_by='date' = newest first. Only karar_tarihi_start = start..today. One issue: give start==end, or no query and only start (default today) to list/filter that day live. Index missing → single-day fallback + warning. Ids: 20260731-1, mükerrer 20230309m1-1. - 'aym' — Anayasa Mahkemesi (bireysel başvuru + norm denetimi kararları, tam metin) - 'aihm' — AİHM/ECHR via HUDOC (EXPERIMENTAL ama arama ve get_document CANLI çalışır; Türkiye aleyhine kararlar). Varsayılan olarak Türkçe çeviriler (dil='TUR') döner; Türkçe yoksa ENG/FRE'ye düşer ve warnings'e yazar. karar_tarihi_start/_end HUDOC kpdate alanına bağlanır. Kısa anahtar kelime/dava adı yazın (ör. "Kavala"). - 'btk' — BTK Kurul Kararları (PARTIAL; HTML card scraping with PDF download for full text) query: Search query string (optional when filtering by docket no / chamber / date). For best results, craft a short 2–5 term keyword query using the operators above. limit: Max results (default 10, must be positive). page: Page number for pagination (default 1). court_types: Optional list of court item types for multi-court search in a single call. Bedesten values (exact spelling — verified live): YARGITAYKARARI (Yargıtay), DANISTAYKARAR (Danıştay, no trailing I), YERELHUKUK (yerel hukuk mahkemeleri), ISTINAFHUKUK (bölge adliye hukuk daireleri), KYB (kanun yararına bozma). Defaults to ["YARGITAYKARARI", "DANISTAYKARAR"] when source=bedesten and omitted. An unrecognised value is rejected with INVALID_COURT_TYPE — Bedesten answers a bogus itemType with a silent total=0 that is indistinguishable from "no such precedent", so we never forward one. birimAdi: Optional chamber code. Yargıtay H1–H23 / C1–C23 (hukuk / ceza daireleri), HGK, CGK, BGK; Danıştay D1–D17, IDDK, VDDK; AYIM. Full list: list_sources(detail="birim_codes"). karar_tarihi_start: Optional ISO start date, inclusive (e.g. "2023-01-01"). karar_tarihi_end: Optional ISO end date, inclusive (e.g. "2024-12-31"). esas_no: Optional case file number, YIL/SIRA ("2023/1234"). karar_no: Optional decision number, YIL/SIRA ("2023/5678"). sort_by: Result ordering — "relevance" (Solr score, default when a query/phrase is present) or "date" (newest first, default when only filters like esas_no/karar_no/date range are given). When omitted, the source infers: non-empty query → relevance, filter-only lookup → date. include_snippets: When true, fetch the full text of the first 5 results and attach a snippet (~360-char passage centred on the query terms) to each. Lets you triage relevance without calling get_document per result. Results already in the local corpus get a snippet for free even when this is false. dil: Yalnızca source='aihm': belge dili. Verilmezse önce Türkçe çeviriler ('TUR'), sonuç yoksa ENG/FRE. 'ENG', 'FRE', 'TUR', virgülle çoklu ('ENG,FRE') ya da 'HEPSI' (tüm diller; Almanca, Rumence vb. üçüncü dil çevirileri dahil). include_raw: When true, keep the raw upstream metadata block. Default false: fields duplicated by the flat keys (esas_no, karar_no, decision_date, chamber, ...) are dropped to save context. Nothing unique is lost.

Returns: Dict with results, pagination metadata, and optional warnings. The results key holds the list of matching document dicts. total_results (int or null) is the total count across pages, page (int) the current page, and total_pages (int or null) the total number of pages. When the source cannot provide a total (e.g. Mevzuat search), total_results and total_pages are null and a warning is appended. Example::

    {
      "results": [ /* SearchResult dicts */ ],
      "total_results": 543,
      "page": 1,
      "total_pages": 55
    }
NameRequiredDescriptionDefault
dilNo
pageNo
limitNo
queryNo
sourceNo
esas_noNo
sort_byNo
birimAdiNo
karar_noNo
court_typesNo
include_rawNo
include_snippetsNo
karar_tarihi_endNo
karar_tarihi_startNo

Output Schema

NameRequiredDescription
resultYes

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: two-pass AND→OR fallback reported via warnings/fallback_to_or, character whitelist and query sanitization, INVALID_COURT_TYPE rejection to avoid indistinguishable silent zero-results, unstemmed-index token behavior, and the AİHM TUR→ENG/FRE language fallback. This is unusually rich operational disclosure.

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

Conciseness3/5

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

The purpose and rules are front-loaded and organized under headers, which helps with 14 parameters. However the prose is bloated with dramatized emphasis ('HARD RULES — no exceptions', repeated ⚠️ blocks, emoji) that adds length without adding actionable detail, making it heavier than necessary for the information conveyed.

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 14-parameter, zero-annotation research tool, the description is complete: query construction, source switching, filtering, pagination, and fallback semantics are all covered, and an output schema exists to carry the return structure. Nothing essential to correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate and largely does: it enumerates valid source values with their distinct behaviors, exact court_types spellings, birimAdi chamber codes, date format and inclusivity, esas_no/karar_no YIL/SIRA format, sort_by inference rules, and the effects of include_snippets/include_raw/dil. Nearly all 14 parameters gain meaning beyond their bare typed names.

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?

Opens with a specific verb+resource+scope: it retrieves live court decisions, precedents, case law and legislation from official sources. It explicitly differentiates itself from siblings, stating it is the only tool that fetches live from Bedesten/Yargıtay/Mevzuat, and names search_local_corpus as the tool that cannot discover decisions. An agent can identify its role without reading the schema.

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?

Gives explicit when-to-use ('For ANY case-law question ... you MUST call THIS tool first'), when-not-to-use ('Do NOT answer from memory', 'Do NOT use search_local_corpus to FIND decisions'), and the follow-up workflow (verify via get_document). Alternatives and preconditions are spelled out rather than inferred.

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

search_legislationA

Search legislation via the Mevzuat source.

Use mevzuat_adi to search ONLY in titles (e.g. "kişisel veri" → KVKK surfaces). Use mevzuat_no for direct lookup by official number (e.g. "6698" → KVKK, "5237" → TCK) — never guess the number; if unsure use mevzuat_adi first. query does a body-text/concept search. Common abbreviations (TCK, HMK, KVKK, ...) in query are auto-routed to mevzuat_no.

Args: query: Search phrase (body-text). Auto-routes TCK/HMK/etc → number. sources: Source IDs (default: ["mevzuat"]). legislation_type: Filter by type (e.g. "Kanun", "Yönetmelik"). limit: Max results. scope: 'law' (default) or 'article'. document_id: Required when scope='article'. sort_by: "relevance" (default) | "date" | "kayit_tarihi". mevzuat_adi: Title-only search. mevzuat_no: Official legislation number (NEVER guess). mevzuat_tur_list: Multi-type filter (KANUN, KHK, YONETMELIK, ...).

Returns: Dict with ok, query, results, total_results, warnings, etc.

NameRequiredDescriptionDefault
limitNo
queryYes
scopeNolaw
sort_byNo
sourcesNo
mevzuat_noNo
document_idNo
mevzuat_adiNo
legislation_typeNo
mevzuat_tur_listNo

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose non-obvious behavior: abbreviations in query are auto-routed to mevzuat_no, scope='article' requires document_id, and the return shape (ok, query, results, total_results, warnings). It stops short of stating pagination behavior, error handling, or any auth/cost constraints, keeping it below a 5.

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 the highest-value routing rules before the parameter list, and the Args/Returns structure is scannable. Some entries are terse to the point of near-redundancy (limit: 'Max results'), but overall every section 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?

For a 10-parameter tool with no annotations and no output schema, the description covers parameter meaning and summarizes the return dict, which is the right level of detail. Gaps remain around limit/pagination interplay and failure modes, but nothing critical to invoking it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description documents all ten parameters with examples and constraints: mevzuat_adi with a worked example, mevzuat_no with '6698'→KVKK, scope values 'law'/'article' plus the document_id dependency, sort_by's three options, and mevzuat_tur_list's type values. This fully compensates for the empty 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?

States a specific verb+resource ('Search legislation via the Mevzuat source') and immediately clarifies the three search modes (title, number, body-text). It does not explicitly differentiate itself from siblings like search_decisions, mevzuat_korpus_ara, or search_local_corpus, so an agent must infer the boundary, but the core purpose is unambiguous.

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

Usage Guidelines4/5

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

Gives concrete routing guidance: use mevzuat_adi for titles, mevzuat_no for official numbers with an explicit warning ('never guess the number; if unsure use mevzuat_adi first'), and query for body-text. This is strong intra-tool guidance, but it never says when to prefer this tool over sibling search tools, so no explicit alternatives are named.

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

search_local_corpusA

Concept DISCOVERY over the local corpus.

Searches the local corpus (decisions already fetched this session or via the corpus crawl) for a legal CONCEPT when the exact wording is unknown. Each result carries related_quotes — matched passages — so you can spot relevant precedent without fetching every full text.

Roles are complementary: THIS tool = DISCOVERY over the local corpus; search_decisions = live CURRENT search + citation verification. The corpus may lag; always confirm any decision you cite with search_decisions + get_document first.

QUERY FORM: 2–6 legal keywords, NOT a sentence. All terms are required (AND) and match anywhere in the text, so narrative filler only shrinks the result set. Quote words to require them adjacent: kıdem tazminatı zamanaşımı · "tahliye taahhüdü" geçerlilik. Unlike Bedesten this index folds diacritics (kamulastirma = kamulaştırma).

Args: query: 2–6 legal keywords; "quoted spans" match as phrases. mode: 'lexical' (default; FTS5/BM25, sub-second), 'rrf' (BM25+TF-IDF fusion; SLOW — minutes on a large corpus), 'semantic' (dense embeddings), 'hybrid'. limit: Max results. filters: Optional dict with source, court, chamber, content_status. provider: Embedding provider name for semantic modes (ignored for lexical). source/court/chamber/date/esas_no/karar_no/document_id: Flat filters — equivalent to putting them in filters. content_status/draft_usable/quote_usable: Content filters. sort: 'relevance' (default) or 'date' — lexical mode only.

NameRequiredDescriptionDefault
dateNo
modeNolexical
sortNorelevance
courtNo
limitNo
queryYes
sourceNo
chamberNo
esas_noNo
filtersNo
karar_noNo
providerNo
document_idNo
draft_usableNo
quote_usableNo
content_statusNo

TDQS

A4.9/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden, and it delivers: corpus staleness, the mandated verification workflow, per-mode latency ('rrf' SLOW — minutes on a large corpus), AND-match semantics, and diacritic folding. It also discloses the return shape via 'related_quotes — matched passages', which is valuable with no output schema.

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?

Front-loaded with the one-line purpose, then cleanly sectioned into Roles, QUERY FORM, and Args. The length is justified by the 16 undocumented parameters and the query-syntax rules; 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?

Given 16 params, 0% schema coverage, no annotations, and no output schema, the description still tells an agent how to phrase the query, which mode to pick and its cost, how to filter, and what the results contain. Nothing essential to a correct call is missing.

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?

With 0% schema description coverage the description must compensate, and it does for the high-impact params: query form and quoting, every mode value with performance trade-offs, limit, sort ('lexical mode only'), provider, and the group of flat filters explained as equivalents to 'filters'. Minor gaps remain (accepted values for content_status, date format, the bundled content filters), which keeps it short of a 5.

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?

Opens with 'Concept DISCOVERY over the local corpus' and specifies the resource (decisions fetched this session or via corpus crawl) and the trigger condition (when exact wording is unknown). It explicitly differentiates itself from the sibling search_decisions, so an agent can choose between them without reading either schema.

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?

States the complementary roles directly: 'THIS tool = DISCOVERY over the local corpus; search_decisions = live CURRENT search + citation verification.' It gives an explicit caveat ('the corpus may lag') and a required follow-up ('always confirm any decision you cite with search_decisions + get_document first'), which is precisely the when/when-not/alternative guidance.

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. 11 tool updatesv2.0.0
    • First observedexport_document
    • First observedget_document
    • First observedget_legislation
    • First observedhealth_check
    • First observedload_extended_tools
    • First observedmevzuat_korpus_ara
    • First observedmevzuat_madde_getir
    • First observedresearch_topic
    • First observedsearch_decisions
    • First observedsearch_legislation
    • First observedsearch_local_corpus

TDQS

B3.4/5.0

Scored across 11 tools

Disambiguation2/5

The search surface is heavily overlapping: mevzuat_korpus_ara, search_local_corpus, search_decisions, search_legislation all perform searches with only subtle distinctions (local vs live, decisions vs legislation). Descriptions spend enormous effort explaining which to use and the corpus-lag nuance, which itself signals the boundaries are unclear; search_legislation vs mevzuat_korpus_ara vs get_legislation further blur retrieval vs fetch.

Naming Consistency2/5

Names mix English and Turkish (search_decisions vs mevzuat_korpus_ara vs mevzuat_madde_getir), and verb styles vary (get_document, get_legislation, mevzuat_madde_getir, search_*, research_topic, load_extended_tools, health_check). There is a loose verb_noun pattern but the Turkish/English split and inconsistent word order make it unpredictable.

Tool Count4/5

11 core tools for a legal research server is well within a reasonable range, and the load_extended_tools mechanism sensibly gzips the broader surface into categories rather than exposing everything upfront.

Completeness4/5

Search, fetch, legislation retrieval, research bundle, export and health check cover the core legal-research lifecycle; drafting, citation check, file reading and PII are gated behind load_extended_tools rather than absent. Minor gaps: no direct delete/cleanup or a default-visible listing of extended tools' own availability.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables MCP-compatible AI clients to research official Turkish legal sources locally by searching judicial decisions, legislation, and Constitutional Court decisions, and by retrieving legal documents, individual articles, and legislation structures.
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    Connects AI clients to public Turkish legislation and court/board decisions, letting users search and retrieve legal texts, case law, and institutional rulings, and generate petition drafts and UYAP UDF files.
    20
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants and agents to search a legal document collection via hybrid BM25+dense retrieval, read articles with context, and generate full or short citations. It also exposes whole acts as Markdown resources, provides a citation-answering prompt, and supports stdio and streamable HTTP transports.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables local, privacy-conscious research across Turkish case law and legislation by searching precedent and statutes, retrieving decisions and article trees/content, and assembling sourced research drafts with verified quotations.
    -