Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
EMSAL_MCP_HOSTNoHTTP dinleme adresi127.0.0.1
EMSAL_MCP_PORTNoHTTP dinleme portu8790
EMSAL_CACHE_PATHNoKorpus SQLite dosyası. Varsayılan: ~/.emsal_mcp/cache.sqlite3~/.emsal_mcp/cache.sqlite3
EMSAL_BULK_VEC_DIRNofp16 vektör sidecar'ları (refine için). Örnek: <bench-dizini>\vec
EMSAL_TOOL_PROFILENoAraç profili: 'core' (varsayılan) veya 'full'core
EMSAL_TOOL_THREADSNoSync araçları için thread havuzu (0 = kapalı)6
EMSAL_TOOL_TIMEOUTNoAraç başına saniye sınırı180
EMSAL_MCP_TRANSPORTNoTaşıma katmanı: 'stdio' (varsayılan) veya 'streamable-http'stdio
EMSAL_EMBEDDING_PROVIDERNoGömme sağlayıcısı. Örnek: fastembed-multilingual-e5
EMSAL_EMBEDDING_CACHE_DIRNoONNX model önbelleği. Örnek: <veri-dizini>\models\fastembed

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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
    }
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``.
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.

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.

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.

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.

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.

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.

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).

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.

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.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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