birthdays_today
Retrieve a list of Dutch Members of Parliament celebrating their birthdays today, including names, political parties, and birth dates. Use for 'on this day' content or specific birthday inquiries. Returns JSON data for easy integration.
Instructions
Lists all Members of Parliament celebrating their birthday today, including their names, political parties, and birth dates. The response is a JSON array where each entry contains the MP's ID, name, party affiliation, and other details. Use this tool when a user specifically asks about birthdays, wants to know which MPs are celebrating today, or needs to create 'on this day' content. This tool takes no parameters as it always returns today's birthdays. For a more general overview that includes birthdays along with other parliamentary information, use the 'get_overview' tool instead. If you need to display an MP's photo alongside their birthday information, you can use the 'get_photo' tool with the MP's ID from this response.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:59-75 (handler)The complete registration, schema (empty input), and inline handler for the 'birthdays_today' MCP tool. The handler fetches JSON data from the '/jarig-vandaag' API endpoint using apiService and returns it as a formatted text content block, with error handling."birthdays_today", "Lists all Members of Parliament celebrating their birthday today, including their names, political parties, and birth dates. The response is a JSON array where each entry contains the MP's ID, name, party affiliation, and other details. This tool takes no parameters as it always returns today's birthdays. Applicable when information about MPs' birthdays is needed.", {}, async () => { try { const data = await apiService.fetchJson(`/jarig-vandaag`); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error fetching birthdays: ${error.message || 'Unknown error'}` }] }; } } );
- src/services/api.ts:34-71 (helper)The generic fetchJson helper method in ApiService used by the birthdays_today handler to retrieve JSON data from the tkconv API endpoint '/jarig-vandaag'.async fetchJson<T>(path: string, options: RequestInit = {}): Promise<T> { try { // Ensure the path starts with a slash const normalizedPath = path.startsWith('/') ? path : `/${path}`; // Set default headers if not provided const headers = { 'User-Agent': 'Mozilla/5.0 (compatible; OpenTK-MCP/1.0)', ...options.headers }; const res = await fetch(`${BASE_URL}${normalizedPath}`, { ...options, headers, agent: ApiService.agent } as NodeRequestInit); if (!res.ok) { throw new Error(`API error: ${res.status} ${res.statusText}`); } const text = await res.text(); // Check if the response is HTML if (text.trim().startsWith('<!DOCTYPE')) { return {} as T; } // Parse JSON try { return JSON.parse(text) as T; } catch (error) { return {} as T; } } catch (error) { throw error; } }