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);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it states the tool retrieves data (implying read-only), it doesn't address important behavioral aspects like authentication requirements, rate limits, error conditions, or what format the 'detailed data' includes. For a tool with no annotation coverage, this leaves significant gaps in understanding how the tool behaves in practice.

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?

The description is a single, efficient Japanese sentence that directly states the tool's purpose without any unnecessary words. It's appropriately sized for a simple retrieval tool and front-loads the essential information. Every word earns its place in conveying the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for effective tool use. While it states what the tool does, it doesn't explain what 'detailed data' includes, potential response formats, or any behavioral constraints. For a data retrieval tool with no structured output documentation, the description should provide more context about what to expect from the tool's execution.

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?

The description mentions that a law number must be specified ('法令番号を指定して'), which aligns with the single required parameter 'lawNum'. However, the input schema already provides 100% coverage with a clear description and example format. The description adds minimal value beyond what's already documented in the schema, meeting the baseline for high schema coverage.

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?

The description clearly states the tool's purpose: '法令番号を指定して法令の詳細データを取得します' (Retrieve detailed law data by specifying a law number). It specifies both the action (取得します - retrieve) and resource (法令の詳細データ - detailed law data), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like get_law_revision or search_law, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools (get_law_revision, search_law) or explain when this specific retrieval method is appropriate versus searching or getting revisions. The agent must infer usage from the tool name and description alone, which is insufficient for optimal tool selection.

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

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