Skip to main content
Glama

get_law_data

Retrieve detailed Japanese legal information by specifying a law number, enabling access to official legal data from the e-Gov Law API for research or compliance purposes.

Instructions

法令番号を指定して法令の詳細データを取得します。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lawNumYes法令番号(例: 平成十七年法律第百十七号)

Implementation Reference

  • The handler function that implements the get_law_data tool. It takes lawNum, fetches data from the EGOV API, truncates if too long, and returns formatted text response.
    async getLawData(args) {
      const { lawNum } = args;
      
      const url = `${EGOV_API_BASE}/lawdata/${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.substring(0, 10000)}${data.length > 10000 ? '\n...(省略)' : ''}`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`法令データの取得に失敗しました: ${error.message}`);
      }
    }
  • Input schema for the get_law_data tool, defining the required 'lawNum' parameter as a string.
    inputSchema: {
      type: 'object',
      properties: {
        lawNum: {
          type: 'string',
          description: '法令番号(例: 平成十七年法律第百十七号)',
        },
      },
      required: ['lawNum'],
    },
  • index.js:71-84 (registration)
    Registration of the get_law_data tool in the setTools call, including name, description, and schema.
    {
      name: 'get_law_data',
      description: '法令番号を指定して法令の詳細データを取得します。',
      inputSchema: {
        type: 'object',
        properties: {
          lawNum: {
            type: 'string',
            description: '法令番号(例: 平成十七年法律第百十七号)',
          },
        },
        required: ['lawNum'],
      },
    },
  • index.js:110-111 (registration)
    Dispatch/registration in the switch statement that routes calls to the getLawData handler.
    case 'get_law_data':
      return await this.getLawData(args);

Tool Definition Quality

Score is being calculated. Check back soon.

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