get_law_revision
Retrieve revision history for Japanese laws by providing a law number to track amendments and changes over time.
Instructions
法令の改正履歴を取得します。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lawNum | Yes | 法令番号(例: 平成十七年法律第百十七号) |
Implementation Reference
- index.js:190-214 (handler)The main handler function for the 'get_law_revision' tool. It takes a lawNum argument, constructs the e-Gov API URL for law revisions, fetches the data, and returns it formatted as MCP content.async getLawRevision(args) { const { lawNum } = args; const url = `${EGOV_API_BASE}/lawrevisions/${encodeURIComponent(lawNum)}`; try { const response = await fetch(url); if (!response.ok) { throw new Error(`API request failed: ${response.status}`); } const data = await response.text(); return { content: [ { type: 'text', text: `改正履歴(法令番号: ${lawNum}):\n\n${data}`, }, ], }; } catch (error) { throw new Error(`改正履歴の取得に失敗しました: ${error.message}`); } }
- index.js:88-97 (schema)Input schema for the 'get_law_revision' tool, defining the required 'lawNum' parameter as a string.inputSchema: { type: 'object', properties: { lawNum: { type: 'string', description: '法令番号(例: 平成十七年法律第百十七号)', }, }, required: ['lawNum'], },
- index.js:85-98 (registration)Tool registration in the ListToolsRequestHandler response, providing name, description, and schema for 'get_law_revision'.{ name: 'get_law_revision', description: '法令の改正履歴を取得します。', inputSchema: { type: 'object', properties: { lawNum: { type: 'string', description: '法令番号(例: 平成十七年法律第百十七号)', }, }, required: ['lawNum'], }, },
- index.js:112-113 (registration)Registration in the CallToolRequestHandler switch statement, routing calls to 'get_law_revision' to the getLawRevision method.case 'get_law_revision': return await this.getLawRevision(args);