Skip to main content
Glama
karnagge

MCP DivulgaCandContas Server

by karnagge

consultar_prestador_contas

Retrieve campaign finance records for Brazilian political candidates using election codes, year, municipality, position, and candidate identifiers.

Instructions

Consulta informações sobre prestação de contas de um candidato

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eleicaoYesCódigo da eleição
anoYesAno da eleição (ex: 2020)
municipioYesCódigo do município
cargoYesCódigo do cargo
candidatoYesCódigo do candidato

Implementation Reference

  • Handler function for the 'consultar_prestador_contas' tool. Parses input using ConsultaPrestadorSchema, makes API call to fetch prestação de contas data, and formats the response.
    case "consultar_prestador_contas": {
      const params = ConsultaPrestadorSchema.parse(args);
      const data = await handleApiRequest(() => 
        httpClient.get(`/prestador/consulta/${params.eleicao}/${params.ano}/${params.municipio}/${params.cargo}/90/90/${params.candidato}`)
      );
      
      return {
        content: [
          {
            type: "text",
            text: `Informações de prestação de contas:\n\n` +
                  `Candidato: ${data.nomeCompleto || 'N/A'}\n` +
                  `Partido: ${data.nomePartido || 'N/A'} (${data.siglaPartido || 'N/A'})\n` +
                  `CNPJ: ${data.cnpj || 'N/A'}\n` +
                  `Total Recebido: R$ ${data.dadosConsolidados?.totalRecebido || 0}\n` +
                  `Total Despesas: R$ ${data.despesas?.totalDespesasPagas || 0}\n\n` +
                  `Detalhes completos:\n${JSON.stringify(data, null, 2)}`
          }
        ]
      };
    }
  • Zod schema for validating input parameters of the 'consultar_prestador_contas' tool.
    const ConsultaPrestadorSchema = z.object({
      eleicao: z.number().int(),
      ano: z.number().int().min(2000).max(new Date().getFullYear()),
      municipio: z.number().int(),
      cargo: z.number().int(),
      candidato: z.number().int()
    });
  • src/index.ts:205-236 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: "consultar_prestador_contas",
      description: "Consulta informações sobre prestação de contas de um candidato",
      inputSchema: {
        type: "object",
        properties: {
          eleicao: {
            type: "number",
            description: "Código da eleição"
          },
          ano: {
            type: "number",
            description: "Ano da eleição (ex: 2020)",
            minimum: 2000,
            maximum: new Date().getFullYear()
          },
          municipio: {
            type: "number",
            description: "Código do município"
          },
          cargo: {
            type: "number", 
            description: "Código do cargo"
          },
          candidato: {
            type: "number",
            description: "Código do candidato"
          }
        },
        required: ["eleicao", "ano", "municipio", "cargo", "candidato"]
      }
    }
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 'consulta' implies a read-only operation, the description doesn't specify whether this requires authentication, has rate limits, returns paginated results, or what format the information takes. For a tool with 5 required parameters and no 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 states the tool's purpose without unnecessary words. It's appropriately sized for a lookup tool and front-loads the essential information. Every word earns its place in conveying 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 complexity (5 required parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what type of financial accountability information is returned, whether results are filtered/sorted, or what happens when parameters don't match existing records. For a tool that likely returns structured financial data, more context about the response format would be helpful.

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?

Schema description coverage is 100%, with all 5 parameters clearly documented in the schema (election code, year, municipality code, position code, candidate code). The description doesn't add any parameter semantics beyond what's already in the schema - it doesn't explain relationships between parameters or provide examples of valid values. The baseline score of 3 reflects adequate but minimal value addition.

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 tool's purpose as 'Consulta informações sobre prestação de contas de um candidato' (Consult information about a candidate's financial accountability), which is a specific verb+resource combination. It distinguishes from siblings like 'consultar_candidato' (general candidate info) by focusing specifically on financial accountability information. However, it doesn't explicitly contrast with other siblings that might also provide financial data.

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. It doesn't mention any prerequisites, context requirements, or comparison to sibling tools like 'consultar_candidato' (which might provide overlapping or complementary information). The agent must infer usage solely from the tool name and parameters.

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