Skip to main content
Glama

deka_by_section

Read-onlyIdempotent

รายการคำพิพากษาฎีกาที่อ้างมาตราหนึ่ง ("มาตรานี้ศาลตีความไว้อย่างไร") — ค้นจากตารางการอ้างอิงที่สกัดจากฎีกา จึงแม่นกว่าค้นด้วยคำ. ใช้เมื่อรู้ชื่อกฎหมาย+มาตราแล้ว · ยังไม่รู้มาตรา/ค้นตามข้อเท็จจริง → search_law(corpus="deka") · รู้เลขฎีกาแล้วอยากอ่านเต็ม → get_deka · ตรวจว่าฎีกาหนึ่งอ้างมาตรานั้นจริง → verify_citation(deka_no, cited_law, cited_section) นับโควตา 1 ครั้งต่อการเรียก · อ่านอย่างเดียว · บริการฎีกาปิดชั่วคราวไม่หักโควตา (count=0 + reason="temporarily_unavailable")

อ่านผล: results = [{no, year_be, verdict, department, doctitle}] เรียงเลขฎีกาใหม่→เก่า ไม่มี full_text (อ่านเต็มด้วย get_deka(no)) · verdict=None ได้ตามปกติ ไม่ได้แปลว่าคดีไม่มีผล

  • count=0 + reason="ambiguous_law" = ชื่อนี้มีหลายฉบับ (ต่างปี) ไม่เดาให้ → เลือกจาก candidates แล้วเรียกซ้ำด้วยชื่อเต็ม · reason="law_not_found" = ไม่รู้จักชื่อนี้ (candidates = ชื่อใกล้เคียง) · count=0 ไม่มี reason = ชื่อถูก โดยทั่วไปแปลว่าไม่พบ ฎีกาอ้างมาตรานี้ในคลัง — ไม่ใช่หลักฐานว่าไม่มีบรรทัดฐาน (คลังไม่ครบทุกฉบับ และ related_laws เป็น best-effort อาจไม่แนบตอนระบบช้า)

  • law_resolved = ชื่อฉบับที่ใช้ค้นจริง (เมื่อชื่อที่ส่งไม่ตรงรูปที่เก็บแต่ระบุได้ฉบับเดียว)

  • related_laws ไม่ว่าง (ทั้งตอนมีผลและผลว่าง) = ฎีกาของมาตราเดียวกันอยู่ใต้ชื่อรูปอื่นอีกชุด (เช่น ชื่อเปล่ากับชื่อที่มี พ.ศ.) ต้องการครบให้เรียกซ้ำทีละชื่อ ห้ามรวมเป็นฉบับเดียวเอง · count ในนั้น = การอ้างอิงทั้งฉบับ ไม่ใช่ของมาตรานี้

Input Schema

NameRequiredDescriptionDefault
lawYesชื่อย่อกฎหมาย เช่น "ป.อ." "ป.พ.พ." "ป.วิ.อ." "ป.วิ.พ." หรือชื่อ พ.ร.บ. เช่น "พ.ร.บ.คุ้มครองแรงงาน" (มี/ไม่มี "พ.ศ.xxxx" ก็ได้ — ชื่อที่มีหลายปีจะได้ ambiguous_law) · ค่าที่แน่นอนดูได้จาก browse(kind="law_abbreviations") หรือ citation.law_abbrev ของ search_law
limitNoจำนวนฎีกาสูงสุด 1–50 (ค่าเริ่มต้น 20)
sectionYesเลขมาตรา เช่น "288" "๒๘๘" "มาตรา 288" "193 ทวิ" "7/1" — แปลงเลขไทย/ตัดคำว่า "มาตรา"/"ม." ให้เอง · ไม่รับวรรค/อนุมาตรา (ส่งมา + ไม่พบ = reason="section_format_unsupported")

Output Schema

NameRequiredDescriptionDefault
lawNo
countNo
quotaNo
reasonNo
resultsNo
sectionNo
candidatesNo
disclaimerNo
attributionNo
law_resolvedNo
related_lawsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / section / description
      Previous value: -"เลขมาตราอารบิกเปล่า เช่น \"288\" · มาตราขยายใช้รูป \"193 ทวิ\" · เทียบตรงตัว: ไม่แปลงเลขไทย และไม่ตัดคำว่า \"มาตรา\" ให้ (ส่งผิดรูป = count=0 ไม่มี reason)"New value: +"เลขมาตรา เช่น \"288\" \"๒๘๘\" \"มาตรา 288\" \"193 ทวิ\" \"7/1\" — แปลงเลขไทย/ตัดคำว่า \"มาตรา\"/\"ม.\" ให้เอง · ไม่รับวรรค/อนุมาตรา (ส่งมา + ไม่พบ = reason=\"section_format_unsupported\")"
  2. Changed3 schema fields changed
    • changedInput schema / properties / law / description
      Previous value: -"ชื่อย่อกฎหมาย เช่น \"ป.อ.\" \"ป.พ.พ.\" \"ป.วิ.อ.\" \"ป.วิ.พ.\" หรือชื่อ พ.ร.บ. เช่น \"พ.ร.บ.คุ้มครองแรงงาน\" (มี/ไม่มี \"พ.ศ.xxxx\" ก็ได้)"New value: +"ชื่อย่อกฎหมาย เช่น \"ป.อ.\" \"ป.พ.พ.\" \"ป.วิ.อ.\" \"ป.วิ.พ.\" หรือชื่อ พ.ร.บ. เช่น \"พ.ร.บ.คุ้มครองแรงงาน\" (มี/ไม่มี \"พ.ศ.xxxx\" ก็ได้ — ชื่อที่มีหลายปีจะได้ ambiguous_law) · ค่าที่แน่นอนดูได้จาก browse(kind=\"law_abbreviations\") หรือ citation.law_abbrev ของ search_law"
    • changedInput schema / properties / limit / description
      Previous value: -"จำนวนสูงสุด (ค่าเริ่มต้น 20)"New value: +"จำนวนฎีกาสูงสุด 1–50 (ค่าเริ่มต้น 20)"
    • changedInput schema / properties / section / description
      Previous value: -"เลขมาตรา เช่น \"288\" (มาตราขยายใช้รูป \"193 ทวิ\")"New value: +"เลขมาตราอารบิกเปล่า เช่น \"288\" · มาตราขยายใช้รูป \"193 ทวิ\" · เทียบตรงตัว: ไม่แปลงเลขไทย และไม่ตัดคำว่า \"มาตรา\" ให้ (ส่งผิดรูป = count=0 ไม่มี reason)"
  3. Changed2 schema fields changed
    • addedInput schema / properties / law / maxLength
      Added value: +1000
    • addedInput schema / properties / section / maxLength
      Added value: +200
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only/idempotent/non-destructive, and the description adds substantial behavior beyond them: quota cost of 1 per call, no quota charged when the service is temporarily down (count=0 + reason), ambiguous_law / law_not_found / section_format_unsupported handling, and the important caveat that an empty result is not evidence of no precedent (incomplete corpus, best-effort related_laws).

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 and sibling routing are front-loaded, then results shape, then error/edge-case bullets — a sensible order with high information density. It is long and dense (nested parentheticals, multiple bullet groups), which costs some scannability, but nearly every line carries operational meaning.

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?

Despite an output schema being present, the description still spells out the result fields (no, year_be, verdict, department, doctitle), ordering (newest first), absence of full_text with a pointer to get_deka, and the verdict=None interpretation. Combined with the error-state taxonomy, an agent has everything needed to call and interpret results.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds value by tying parameter outcomes to behaviors — abbreviated law names, names with vs. without พ.ศ. producing ambiguous_law, and section formats that are accepted vs. rejected (วรรค/อนุมาตรา → section_format_unsupported). Most of this is echoed in the schema text, so it is enrichment rather than new semantics.

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?

Starts with a concrete verb+resource: a list of Supreme Court judgments citing a given section, and explains the retrieval mechanism (citation-reference table extracted from judgments, more precise than keyword search). It explicitly distinguishes itself from search_law, get_deka, and verify_citation, so an agent can route 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 Guidelines5/5

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

Gives explicit when-to-use ("use when you already know the law name + section"), explicit when-not with a named alternative ("don't know the section / want fact-based search → search_law(corpus=\"deka\")", "know the deka number → get_deka", "check whether a judgment actually cites it → verify_citation"). The routing decision is fully determined.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources