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
| Name | Required | Description | Default |
|---|---|---|---|
| data_id | Yes | 通達のdataId。search_mhlw_tsutatsu の検索結果から取得。例: "00tb2035" | |
| page_no | No | ページ番号(デフォルト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 }; } - src/tools/get-mhlw-tsutatsu.ts:5-43 (registration)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, }; } } ); }