Skip to main content
Glama

get_law_versions

Read-onlyIdempotent

รายการฉบับแก้ไขทั้งหมดของมาตราหนึ่ง เรียงเก่า→ใหม่ — ใช้หา timeline_code ไปเรียก get_law_document เมื่อต้องการถ้อยคำตามฉบับที่ใช้บังคับในอดีต (search_law/get_law_document คืนฉบับล่าสุดเป็นค่าเริ่มต้น). ไม่นับโควตา · อ่านอย่างเดียว

อ่านผล: versions=[{timeline_code, version_seq, is_current}] นับเฉพาะฉบับที่มีมาตรานี้ในตัวบทหลัก · count=0 ไม่ได้แปลว่าไม่มีเนื้อหานี้ในกฎหมายฉบับนี้ — อาจอยู่ในฉบับแก้ไขที่แนบท้าย ให้ตรวจต่อด้วย verify_citation/get_law_document (คืน unit_scope บอกว่ามาจากฉบับใด)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "law_code": "<law_code>",
      "unit_label": "<unit_label>"
    },
    "name": "get_law_versions"
  }
}

Input Schema

NameRequiredDescriptionDefault
law_codeYesรหัสกฎหมาย จาก citation.law_code ของผล search_law
unit_labelYesใช้ citation.unit_label ของผล search_law เช่น "มาตรา 288" — ต้องมีคำนำหน้า "มาตรา"/"ข้อ" (เลขเปล่าได้ผลว่าง)

Output Schema

NameRequiredDescriptionDefault
countYes
law_codeYes
versionsYes
disclaimerYes
unit_labelYes
attributionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / unit_label / description
      Previous value: -"เลขมาตรา จาก citation ของผล search_law (เช่น \"มาตรา 288\")"New value: +"ใช้ citation.unit_label ของผล search_law เช่น \"มาตรา 288\" — ต้องมีคำนำหน้า \"มาตรา\"/\"ข้อ\" (เลขเปล่าได้ผลว่าง)"
  2. Changed2 schema fields changed
    • addedInput schema / properties / law_code / maxLength
      Added value: +200
    • addedInput schema / properties / unit_label / maxLength
      Added value: +200
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds quota information ('ไม่นับโควตา') that is not in the annotations, plus a non-obvious counting rule: only versions where the section appears in the main body are counted, so count=0 does not mean the content is absent. That said, it does not explain ordering guarantees beyond 'old→new' or whether is_current is always exactly one entry.

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 purpose, then usage, then a compact result-reading note separated by line breaks; no filler sentences. It is dense with parenthetical asides, which slightly slows scanning but each clause carries actionable information.

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

Completeness5/5

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

With an output schema present, the description need not restate the return shape, yet the count=0 caveat and the 'main body only' semantics are genuinely non-derivable from the schema and are exactly what prevents a wrong conclusion. Nothing an agent needs to interpret the result correctly is missing.

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 both parameters are documented there, including the citation-derived provenance and the 'มาตรา'/'ข้อ' prefix requirement. The description only indirectly touches parameter meaning via the main-body restriction on unit_label matching, so baseline 3 is appropriate.

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+resource: the list of all amendment versions of one section, ordered old→new, and explicitly frames the output as the timeline_code needed for get_law_document. It also distinguishes itself from search_law/get_law_document by noting those return the latest version by default.

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 an explicit trigger condition (when historical wording in force at an earlier time is needed) plus the alternatives that default to the current text. It also names the correct follow-up path (verify_citation/get_law_document) when count=0, so the agent knows what to do next rather than retrying this tool.

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