Skip to main content
Glama

Search laws and regulations

qv_search
Read-onlyIdempotent

Search Iran's law and regulation database by title or full text, filtering by date, status, approver and subject to find matching laws, regulations, court votes and legal opinions.

Instructions

Search the Iranian law and regulation database (qavanin.ir) and list matching titles.

Returns total, pages and items (id for the other tools, title, approved, approver, repealed). No snippets. Date sort has ties, so deep paging may repeat or skip rows; narrow the filters instead.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "qv_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNolaw (Majlis statutes), regulation, vote (court rulings), opinion.
pageNoFrom 1.
sortNoBy approval date, or alphabetical 'title' (stable for paging).newest
limitNo
matchNoall_words: every whole word; phrase: adjacent; part_of_word: substring (widest); any_word.all_words
queryNoWords to find, e.g. 'مالیات بر ارزش افزوده'.
statusNoLegal status; 'valid' undercounts.
in_textNoSearch full text, not only titles.
list_idNoId from qv_lookup(kind='list'), e.g. 113 latest laws.
type_idNoIds from qv_lookup(kind='type').
command_noNoشماره ابلاغ, digits, substring.
subject_idNoIds from qv_lookup(kind='subject').
approved_toNoJalali 'YYYY/MM/DD'.
approver_idNoIds from qv_lookup(kind='approver'); OR-ed.
executor_idNoIds from qv_lookup(kind='executor').
newspaper_noNoشماره روزنامه رسمی, digits, substring.
approved_fromNoJalali 'YYYY/MM/DD'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed17 schema fields changedv0.2.1
    • changedInput schema / properties / approved_from / description
      Previous value: -"Approval date from, Jalali 'YYYY/MM/DD'."New value: +"Jalali 'YYYY/MM/DD'."
    • changedInput schema / properties / approved_to / description
      Previous value: -"Approval date to, Jalali 'YYYY/MM/DD'."New value: +"Jalali 'YYYY/MM/DD'."
    • changedInput schema / properties / approver_id / description
      Previous value: -"Approving body ids from qv_lookup(kind='approver'); several are OR-ed."New value: +"Ids from qv_lookup(kind='approver'); OR-ed."
    • changedInput schema / properties / command_no / description
      Previous value: -"Notification number (شماره ابلاغ), digits, substring."New value: +"شماره ابلاغ, digits, substring."
    • changedInput schema / properties / executor_id / description
      Previous value: -"Executing body ids from qv_lookup(kind='executor')."New value: +"Ids from qv_lookup(kind='executor')."
    • changedInput schema / properties / in_text / description
      Previous value: -"Search the full text of every law, not only the titles."New value: +"Search full text, not only titles."
    • changedInput schema / properties / kind / description
      Previous value: -"'law' (Majlis statutes), 'regulation', 'vote' (court rulings), 'opinion' (legal opinions)."New value: +"law (Majlis statutes), regulation, vote (court rulings), opinion."
    • removedInput schema / properties / limit / description
      Removed value: -"Results per page."
    • changedInput schema / properties / list_id / description
      Previous value: -"A curated list id from qv_lookup(kind='list'), e.g. 113 for the latest laws."New value: +"Id from qv_lookup(kind='list'), e.g. 113 latest laws."
    • changedInput schema / properties / match / description
      Previous value: -"'all_words' every word as a whole word, 'phrase' words adjacent, 'part_of_word' substring match (the site default, widest), 'any_word' at least one whole word."New value: +"all_words: every whole word; phrase: adjacent; part_of_word: substring (widest); any_word."
    • changedInput schema / properties / newspaper_no / description
      Previous value: -"Official gazette number (شماره روزنامه رسمی), digits, substring."New value: +"شماره روزنامه رسمی, digits, substring."
    • changedInput schema / properties / page / description
      Previous value: -"Page number, from 1."New value: +"From 1."
    • changedInput schema / properties / query / description
      Previous value: -"Words to find, Persian or Arabic letters, e.g. 'مالیات بر ارزش افزوده'."New value: +"Words to find, e.g. 'مالیات بر ارزش افزوده'."
    • changedInput schema / properties / sort / description
      Previous value: -"By approval date, or 'title' (alphabetical by database collation; stable for paging)."New value: +"By approval date, or alphabetical 'title' (stable for paging)."
    • changedInput schema / properties / status / description
      Previous value: -"Legal status. 'repealed' = منسوخه; 'moot' = بااجرامنتفی می شود. 'valid' undercounts."New value: +"Legal status; 'valid' undercounts."
    • changedInput schema / properties / subject_id / description
      Previous value: -"Subject ids from qv_lookup(kind='subject')."New value: +"Ids from qv_lookup(kind='subject')."
    • changedInput schema / properties / type_id / description
      Previous value: -"Document type ids from qv_lookup(kind='type')."New value: +"Ids from qv_lookup(kind='type')."
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive and open-world, so the bar is lower, yet the description adds genuinely non-obvious behavior: results contain no snippets, and approval-date sorting has ties that can duplicate or drop rows during deep paging. It also names the returned fields (total, pages, items) which annotations cannot express.

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 what is searched and what is returned, then two non-obvious caveats. No filler or restated field lists that the schema already provides.

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 17-parameter, annotation-rich search tool with no output schema, the description covers the essentials: what is searched, that only titles are matched unless in_text is used, the returned envelope, and pagination caveats. Minor gap: it does not clarify how the many id filters combine (AND vs OR) beyond the approver_id schema note.

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 94%, so the schema documents nearly all 17 parameters including query, match modes, status, and the id-based filters. The description adds no format or interaction detail beyond that baseline – its only parameter-adjacent contribution is the advice to narrow filters rather than page deeply.

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: search the Iranian law/regulation database (qavanin.ir) and list matching titles. The 'id for the other tools' phrasing hints at how it relates to siblings like qv_law and qv_amendments, but it never explicitly contrasts itself with them, keeping it 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?

Gives one concrete usage rule – when deep paging on date sort may repeat or skip rows, narrow the filters instead of paging deeper – but offers no explicit when-to-use / when-not guidance relative to qv_law or qv_lookup, and no prerequisites. Usage is largely implied by the purpose statement.

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