ly
Overview
Use ly to query Taiwan Legislative Yuan API v2 from the terminal and summarize the result for the user.
Prefer running the CLI over guessing from memory. The CLI returns JSON by default, so inspect the fields you need and synthesize a concise answer instead of dumping the full payload unless the user asks for raw output.
Installation
If ly is not available, install it with:
uv tool install lymcp
Command Selection
- Run
ly ...directly when the command is installed. - If
lyis missing, install it withuv tool install lymcp, then retry the samely ...command. - If installation fails because
uvis missing, network access is restricted, package resolution fails, or the published version does not includely, report the prerequisite clearly.
Command Map
- Use
statfor API statistics. - Use
bills listto find bills by term, session, bill type, proposer, date, status, law number, or other bill filters. - Use
bills get BILL_NOafter a bill number is known. - Use
bills related BILL_NO,bills meets BILL_NO, andbills doc-html BILL_NOfor related bills, deliberation records, and bill document HTML;bills meetssupports meeting, attendee, committee, related-bill, and law filters. - Use
laws listto resolve a law number or law ID from a law name, category, status, authority, or latest version date. - Use
laws get LAW_ID,laws progress LAW_ID,laws bills LAW_ID, andlaws versions LAW_IDafter a law ID is known. - Use
law-versions list,law-versions get LAW_VERSION_ID, andlaw-versions contents LAW_VERSION_IDfor amendment/version workflows. - Use
law-contents listandlaw-contents get LAW_CONTENT_IDfor article text and article-level lookups. - Use
meets listfor meeting discovery by term, session, meeting type, date, committee code, attendee, or meeting ID. - Use
meets get MEET_ID,meets bills MEET_ID,meets interpellations MEET_ID, andmeets ivods MEET_IDafter a meeting ID is known. - Use
votes listto find votes by term, meeting, vote type or time, member position, or gazette document ID; usevotes get VOTE_IDandvotes meets VOTE_IDafter a vote ID is known. - Use
legislators listto resolve legislators by term, party, district, ID, or name. - Use
legislators get TERM NAME,legislators propose-bills TERM NAME,legislators cosign-bills TERM NAME,legislators meets TERM NAME, andlegislators interpellations TERM NAMEfor legislator-scoped workflows. - Use
committees list,committees get COMT_CD, andcommittees meets COMT_CDfor committee workflows. - Use
gazettes list,gazettes get GAZETTE_ID,gazettes agendas GAZETTE_ID,gazette-agendas list, andgazette-agendas get GAZETTE_AGENDA_IDfor gazette workflows;gazettes agendasalso accepts--gazette-numberas the documented query-level filter. - Use
interpellations listandinterpellations get INTERPELLATION_IDfor interpellation workflows. - Use
ivods listandivods get IVOD_IDfor Legislative Yuan video records.
Query Workflow
- Choose the narrowest command group from the user's domain: bills, laws, meets, votes, legislators, committees, gazettes, interpellations, or IVODs.
- If the user gives a name but the CLI command needs an ID, run the relevant
listcommand first with narrow filters and a small--limit. - Use IDs returned by list commands in detail or nested-resource commands.
- For date-sensitive meeting questions, compare Asia/Taipei dates:
latest known: use upstream ordering and do not remove scheduled future records.latest occurred: only use records whose relevant date is on or before the reference date.next scheduled: only use records whose relevant date is after the reference date.
- Use
--fieldsto request upstream output fields when you need a smaller payload. - Use
--compactwhen piping JSON to another tool. Use--output PATHwhen saving a successful response to a file. - Summarize the result in the user's language. Include the exact command when reproducibility helps.
Output And Error Handling
- Successful CLI calls print JSON to stdout.
- Failed API calls print a JSON error envelope to stderr and exit non-zero.
- Do not invent unsupported flags or commands. Run
ly --helporly <group> <command> --helpwhen unsure. - If a command returns no useful records, report that result and show which filters were used. Do not broaden filters silently unless the user asked for exploration.
Examples
- "列出第 11 屆法律案" ->
ly bills list --term 11 --bill-type 法律案 --limit 10 - "查勞動基準法修法歷程" ->
ly laws list --fields 法律編號,名稱 --limit 10, thenly laws versions LAW_ID --limit 20 - "最近已發生的院會討論哪些議案?" ->
ly meets list --meeting-type 院會 --term 11 --limit 20, choose the latest occurred meeting by date, thenly meets bills MEET_ID --limit 50 - "查韓國瑜提案紀錄" ->
ly legislators propose-bills 11 韓國瑜 --limit 20 - "查某委員會會議" ->
ly committees list --fields 委員會代號,委員會名稱, thenly committees meets COMT_CD --term 11 --limit 20 - "查黃國昌在哪些表決投贊成票" ->
ly votes list --agreeing-member 黃國昌 --limit 20