Skip to main content
Glama

get_law_document

Read-onlyIdempotent

ดึงตัวบทกฎหมายเต็มด้วย law_code — ทั้งฉบับ หรือเฉพาะมาตรา (unit_label) และเลือกฉบับแก้ไขได้ (timeline_code). ใช้หลัง search_law ได้ law_code แล้ว · ราชกิจจาฯ ใช้ get_gazette_document · ฎีกาใช้ get_deka · แค่ตรวจว่ามาตรา/ข้อความที่อ้างมีจริง ใช้ verify_citation (คืนสถานะชัดเจนกว่า) นับโควตา 1 ครั้งต่อการเรียก · อ่านอย่างเดียว

อ่านผล:

  • found=False = ไม่เจอ law_code/unit_label/timeline_code นี้

  • full_text=None เมื่อไม่ระบุ unit_label แต่ฉบับยาวเกิน → เลือกมาตราจาก section_index (เฉพาะตัวบทหลัก) แล้วเรียกซ้ำพร้อม unit_label

  • citation.unit_scope ไม่ None = ไม่มีมาตรานี้ในตัวบทหลัก เนื้อหามาจากฉบับแก้ไข/คำสั่งที่แนบท้าย (ค่า = ชื่อฉบับนั้น)

  • เป็นฉบับชำระที่อาจยังไม่รวมการแก้ไขล่าสุด (ดู law_freshness_note)

Input Schema

NameRequiredDescriptionDefault
law_codeYesรหัสกฎหมาย จาก citation.law_code ของผล search_law
unit_labelNoมาตราที่ต้องการ ใช้ citation.unit_label ของผล search_law เช่น "มาตรา 288" — ต้องมีคำนำหน้า "มาตรา"/"ข้อ" (เลขเปล่าไม่เจอ; เลขไทย/อารบิกใช้ได้) · ไม่ระบุ = ทั้งฉบับ (ฉบับยาวจะได้ section_index แทน full_text)
timeline_codeNoระบุ = ฉบับแก้ไขนั้นเจาะจง (จาก get_law_versions); ไม่ระบุ = ฉบับล่าสุด

Output Schema

NameRequiredDescriptionDefault
foundNo
quotaNo
citationNo
law_codeNo
full_textNo
disclaimerNo
attributionNo
section_indexNo
law_freshness_noteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / unit_label / description
      Previous value: -"ระบุ = เฉพาะมาตรานั้น (เช่น \"มาตรา 288\", จาก citation ของผล search_law); ไม่ระบุ = ทั้งฉบับ (มี guard ด้านล่างกัน context blow-up สำหรับประมวลกฎหมายใหญ่)"New value: +"มาตราที่ต้องการ ใช้ citation.unit_label ของผล search_law เช่น \"มาตรา 288\" — ต้องมีคำนำหน้า \"มาตรา\"/\"ข้อ\" (เลขเปล่าไม่เจอ; เลขไทย/อารบิกใช้ได้) · ไม่ระบุ = ทั้งฉบับ (ฉบับยาวจะได้ section_index แทน full_text)"
  2. Changed3 schema fields changed
    • addedInput schema / properties / law_code / maxLength
      Added value: +200
    • changedInput schema / properties / timeline_code / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 200,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / unit_label / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 200,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the readOnly/idempotent annotations, the description discloses the quota cost (1 call per invocation) and the guidance for partial results: full_text=None on long acts means choosing a section from section_index and calling again with unit_label. The remaining return-value notes (found=False, citation.unit_scope, law_freshness_note) are useful, but an output schema exists and likely repeats much of this field-level detail.

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 structure is strong and front-loaded: purpose first, then sibling routing, then result-reading bullets. The 'อ่านผล' block is comparatively long, but each bullet conveys a distinct recovery or interpretation step rather than padding.

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 read-only three-parameter fetch tool with full schema coverage and an output schema, the definition covers prerequisites, alternatives, quota, and the failure/recovery path. What an agent needs in order to call it correctly and act on a partial result is present.

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 schema already documents the 'มาตรา' prefix requirement, the whole-act default, and that timeline_code comes from get_law_versions. The description's mention of the three parameters adds only marginal meaning beyond the schema, so the baseline 3 applies.

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 first sentence states a specific verb and resource (fetch the full legal text by law_code), plus its two scoping options (whole act vs. a specific section, and selecting an amendment version). It is immediately distinguishable from search_law, get_gazette_document, get_deka, and verify_citation, which are all named.

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 an explicit prerequisite (use after search_law yields a law_code) and routes to each alternative by condition: gazette documents go to get_gazette_document, supreme-court rulings to get_deka, and mere existence-checking of a cited section to verify_citation, which it notes returns a clearer status.

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