dip:search
Search German parliamentary documents (Bundestagsdrucksachen) by title to find legislation drafts, inquiries, and reports with metadata and PDF links.
Instructions
Search Bundestagsdrucksachen (parliamentary documents) via DIP API. Matches against document title — not full text. Returns metadata: Dokumentnummer, title, type, date, PDF URL. Use dip:get to retrieve full text (e.g., Gesetzesbegründung) of a specific Drucksache.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search keyword (matched against title) | |
| type | No | Drucksachetyp filter: "Gesetzentwurf", "Beschlussempfehlung und Bericht", "Kleine Anfrage", "Große Anfrage", "Antrag", etc. | |
| wahlperiode | No | Legislative period (e.g., 20, 21) | |
| herausgeber | No | BT = Bundestag, BR = Bundesrat | |
| date_start | No | Start date (YYYY-MM-DD) | |
| date_end | No | End date (YYYY-MM-DD) | |
| limit | Yes | Max results (default: 10) |
Implementation Reference
- src/providers/dip/tools/search.ts:16-32 (handler)The 'handleSearch' function implements the logic for 'dip:search' by calling the 'searchDrucksachen' method of the 'DipClient' and formatting the results.
export async function handleSearch(client: DipClient, args: Record<string, unknown>): Promise<ToolResult> { const { query, type, wahlperiode, herausgeber, date_start, date_end, limit = 10 } = args as { query: string; type?: string; wahlperiode?: number; herausgeber?: string; date_start?: string; date_end?: string; limit?: number; }; const params: Record<string, string | number> = { 'f.titel': query, rows: limit }; if (type) params['f.drucksachetyp'] = type; if (wahlperiode) params['f.wahlperiode'] = wahlperiode; if (herausgeber) params['f.herausgeber'] = herausgeber; if (date_start) params['f.datum.start'] = date_start; if (date_end) params['f.datum.end'] = date_end; const result = await client.searchDrucksachen(params); const text = `${result.numFound} Treffer\n\n${result.documents.map(formatDoc).join('\n\n---\n\n')}`; return { content: [{ type: 'text', text }] }; } - The definition and input schema for the 'dip:search' tool.
{ name: 'dip:search', description: 'Search Bundestagsdrucksachen (parliamentary documents) via DIP API. ' + 'Matches against document title — not full text. ' + 'Returns metadata: Dokumentnummer, title, type, date, PDF URL. ' + 'Use dip:get to retrieve full text (e.g., Gesetzesbegründung) of a specific Drucksache.', inputSchema: z.object({ query: z.string().describe('Search keyword (matched against title)'), type: z.string().optional().describe('Drucksachetyp filter: "Gesetzentwurf", "Beschlussempfehlung und Bericht", "Kleine Anfrage", "Große Anfrage", "Antrag", etc.'), wahlperiode: z.number().optional().describe('Legislative period (e.g., 20, 21)'), herausgeber: z.enum(['BT', 'BR']).optional().describe('BT = Bundestag, BR = Bundesrat'), date_start: z.string().optional().describe('Start date (YYYY-MM-DD)'), date_end: z.string().optional().describe('End date (YYYY-MM-DD)'), limit: z.number().optional().default(10).describe('Max results (default: 10)'), }), }, - src/providers/dip/provider.ts:17-17 (registration)Registration of the 'dip:search' tool in the provider's tool call handler.
case 'dip:search': return handleSearch(this.client, args);