Skip to main content
Glama

get_mhlw_tsutatsu

Retrieve the full text of Japanese labor ministry administrative circulars using data IDs from search results to access official legal documents for compliance and reference.

Instructions

厚生労働省の通達本文を取得する。search_mhlw_tsutatsu で取得した data_id を指定。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_idYes通達のdataId。search_mhlw_tsutatsu の検索結果から取得。例: "00tb2035"
page_noNoページ番号(デフォルト1)。長い通達は複数ページに分かれている場合がある。

Implementation Reference

  • The actual business logic implementation for fetching the MHLW tsutatsu (notification) document.
    export async function getMhlwTsutatsu(opts: {
      dataId: string;
      pageNo?: number;
    }): Promise<MhlwDocument> {
      const pageNo = opts.pageNo ?? 1;
      const html = await fetchMhlwDocument(opts.dataId, pageNo);
    
      // MHLW がエラーページを返した場合を検出(<title>エラー</title>)
      if (html.includes('<title>エラー</title>')) {
        const errMatch = html.match(/\[ERR[^\]]*\]([^<]*)/);
        const errMsg = errMatch ? errMatch[1].trim() : '通達が見つかりません';
        throw new Error(`MHLW エラー (dataId: ${opts.dataId}): ${errMsg}`);
      }
    
      const { title, body } = parseMhlwDocument(html);
      const url = getMhlwDocUrl(opts.dataId, pageNo);
    
      return { title, dataId: opts.dataId, body, url };
    }
  • The tool registration and MCP handler definition for get_mhlw_tsutatsu.
    export function registerGetMhlwTsutatsuTool(server: McpServer) {
      server.tool(
        'get_mhlw_tsutatsu',
        '厚生労働省の通達本文を取得する。search_mhlw_tsutatsu で取得した data_id を指定。',
        {
          data_id: z.string().describe(
            '通達のdataId。search_mhlw_tsutatsu の検索結果から取得。例: "00tb2035"'
          ),
          page_no: z.number().optional().describe(
            'ページ番号(デフォルト1)。長い通達は複数ページに分かれている場合がある。'
          ),
        },
        async (args) => {
          try {
            const result = await getMhlwTsutatsu({
              dataId: args.data_id,
              pageNo: args.page_no,
            });
    
            const title = result.title || '(タイトル取得不可)';
    
            return {
              content: [{
                type: 'text' as const,
                text: `# ${title}\n\n${result.body}\n\n---\n出典:厚生労働省 法令等データベース\nURL: ${result.url}`,
              }],
            };
          } catch (error) {
            return {
              content: [{
                type: 'text' as const,
                text: `エラー: ${error instanceof Error ? error.message : String(error)}`,
              }],
              isError: true,
            };
          }
        }
      );
    }

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/kentaroajisaka/labor-law-mcp'

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