Skip to main content
Glama
karnagge

MCP DivulgaCandContas Server

by karnagge

listar_cargos_municipio

Retrieve contested political positions for a specific municipality in Brazilian elections using election and municipality codes.

Instructions

Lista os cargos em disputa em um município específico

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eleicaoYesCódigo da eleição
municipioYesCódigo do município

Implementation Reference

  • Handler for the 'listar_cargos_municipio' tool: parses arguments with Zod schema, calls the TSE API to fetch cargos for a specific election and municipality, formats and returns the response.
    case "listar_cargos_municipio": { const params = CargosMunicipioSchema.parse(args); const data = await handleApiRequest(() => httpClient.get(`/eleicao/listar/municipios/${params.eleicao}/${params.municipio}/cargos`) ); return { content: [ { type: "text", text: `Cargos em disputa no município:\n\n` + `Município: ${data.unidadeEleitoralDTO?.nome || 'N/A'}\n` + `UF: ${data.unidadeEleitoralDTO?.sigla || 'N/A'}\n` + `Cargos disponíveis: ${data.cargos?.length || 0}\n\n` + JSON.stringify(data, null, 2) } ] }; }
  • src/index.ts:157-174 (registration)
    Registration of the 'listar_cargos_municipio' tool in the ListToolsRequestHandler, including name, description, and input schema.
    { name: "listar_cargos_municipio", description: "Lista os cargos em disputa em um município específico", inputSchema: { type: "object", properties: { eleicao: { type: "number", description: "Código da eleição" }, municipio: { type: "number", description: "Código do município" } }, required: ["eleicao", "municipio"] } },
  • Zod schema used in the handler for validating the input parameters (eleicao and municipio) for the 'listar_cargos_municipio' tool.
    const CargosMunicipioSchema = z.object({ eleicao: z.number().int(), municipio: z.number().int() });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/karnagge/mcpcand'

If you have feedback or need assistance with the MCP directory API, please join our Discord server