diputados
Access comprehensive data on Argentine deputies with this tool. Retrieve legislative information for research, analysis, or decision-making directly through the MCP Argentina Datos API.
Instructions
Devuelve los diputados.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.ts:473-495 (handler)Handler function that registers and executes the 'diputados' tool. Fetches data using getDiputados(), handles empty results and errors, returns JSON response.server.tool("diputados", "Devuelve los diputados.", {}, async ({}) => { try { const data = await getDiputados(); if (data.length === 0) { return { content: [{ type: "text", text: "No se encontraron diputados" }], }; } return { content: [ { type: "text", text: JSON.stringify(data, null, 2), mimeType: "application/json", }, ], }; } catch (error) { return { content: [{ type: "text", text: "Error al obtener los diputados" }], }; } });
- main.ts:82-85 (schema)Tool schema definition declaring the 'diputados' tool with name, description, and empty parameters schema.name: "diputados", description: "Devuelve los diputados.", parameters: {}, },
- utils/functions.ts:52-56 (helper)Helper function getDiputados that performs the actual API fetch from https://api.argentinadatos.com/v1/diputados/diputados and returns the JSON data.export const getDiputados = async () => { const diputados = await fetch(`${BASE_URL}/diputados/diputados`); const data = await diputados.json(); return data; };