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()
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Lista' implies a read-only operation, it doesn't specify whether this is a safe query, what permissions are needed, if there are rate limits, or the format/scope of the returned data. For a tool with zero annotation coverage, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized for a simple listing tool and front-loads the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'cargos em disputa' entails (e.g., types of positions, data returned), behavioral traits like safety or limitations, or how results are structured, leaving the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with both parameters ('eleicao' and 'municipio') documented as numeric codes. The description adds no additional semantic context beyond what the schema provides, such as example values or format details, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Lista' - lists) and the resource ('cargos em disputa' - positions in dispute) with a specific scope ('em um município específico' - in a specific municipality). It distinguishes itself from siblings like 'listar_candidatos_municipio' by focusing on positions rather than candidates, though it doesn't explicitly mention this distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'listar_candidatos_municipio' or 'consultar_candidato'. It mentions the municipality scope but doesn't specify prerequisites, exclusions, or complementary tools, leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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