senadores
Retrieve current Argentine senators and their legislative data to analyze government representation or track political activity.
Instructions
Devuelve los senadores.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "senadores"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.ts:372-394 (handler)Handler implementation for the 'senadores' tool. Calls getSenadores helper, handles empty data and errors, returns JSON response.
server.tool("senadores", "Devuelve los senadores.", {}, async ({}) => { try { const data = await getSenadores(); if (data.length === 0) { return { content: [{ type: "text", text: "No se encontraron senadores" }], }; } return { content: [ { type: "text", text: JSON.stringify(data, null, 2), mimeType: "application/json", }, ], }; } catch (error) { return { content: [{ type: "text", text: "Error al obtener los senadores" }], }; } }); - main.ts:64-68 (schema)Schema definition for the 'senadores' tool in the MCP server constructor's tools list, indicating no input parameters.
{ name: "senadores", description: "Devuelve los senadores.", parameters: {}, }, - main.ts:371-394 (registration)Registration of the 'senadores' tool using server.tool, including inline handler.
// senadores server.tool("senadores", "Devuelve los senadores.", {}, async ({}) => { try { const data = await getSenadores(); if (data.length === 0) { return { content: [{ type: "text", text: "No se encontraron senadores" }], }; } return { content: [ { type: "text", text: JSON.stringify(data, null, 2), mimeType: "application/json", }, ], }; } catch (error) { return { content: [{ type: "text", text: "Error al obtener los senadores" }], }; } }); - utils/functions.ts:34-38 (helper)Helper function that fetches senators data from the Argentina Datos API.
export const getSenadores = async () => { const senadores = await fetch(`${BASE_URL}/senado/senadores`); const data = await senadores.json(); return data; };