legis:get
Retrieve specific German federal or state legislation by providing jurisdiction and document ID to access full legal texts for research or reference purposes.
Instructions
Retrieve a specific law/norm from German federal or state legislation. BUND: id is "law/section" (e.g., "bgb/823", "gg/Art. 1", "stgb/§ 242"). Länder: id from legis:search results (format varies by state).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Document ID. BUND: "law/section" (e.g., "bgb/823", "gg/Art. 1"). Länder: ID from legis:search. | |
| state | Yes | Jurisdiction (e.g., "BUND", "BW", "NW") | |
| save_path | No | Save full document to file instead of returning content. |
Implementation Reference
- src/providers/legis/index.ts:74-88 (handler)The `handleGet` method in `LegisProvider` implements the `legis:get` tool logic by retrieving the legislation using the appropriate adapter based on the state.
private async handleGet(args: Record<string, unknown>): Promise<ToolResult> { const { id, state, save_path } = args as { id: string; state: string; save_path?: string }; const entry = await this.getAdapter(state).get(state, id); validateConversion(entry.content, `Landesrecht ${state}`); const markdown = `# ${entry.title}\n\n${entry.content}\n\n---\n**Source:** ${entry.url}`; if (save_path) { const { writeFile } = await import('fs/promises'); await writeFile(save_path, markdown, 'utf-8'); return { content: [{ type: 'text', text: `Saved to ${save_path}\n\nTitle: ${entry.title}\nURL: ${entry.url}` }] }; } return { content: [{ type: 'text', text: markdown }] }; } - src/providers/legis/tools/index.ts:20-22 (registration)Registration of the 'legis:get' tool definition in `src/providers/legis/tools/index.ts`.
{ name: 'legis:get', description: