Skip to main content
Glama

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
NameRequiredDescriptionDefault
lawNumYes法令番号(例: 平成十七年法律第百十七号)

Implementation Reference

  • 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}`);
      }
    }
  • 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);
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/groundcobra009/hourei-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server