Skip to main content
Glama
Licinexus

licinexus-mcp

Official
by Licinexus

list_licitacao_resultados

Retrieve winners, prices, and suppliers for a bidding item. Provide the item number to obtain results.

Instructions

List the bidding results (winners, runners-up, prices, suppliers) for a specific item of a licitação. You must specify which item — use list_licitacao_itens first to discover item numbers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numeroControlePNCPNo
orgaoCnpjNo
anoNo
sequencialNo
numeroItemYesThe item number (numeroItem) to retrieve results for.

Implementation Reference

  • Main handler function that parses arguments, resolves the PNCP ID, calls listItemResultados adapter, and returns the bidding results for a specific item.
      async handler(rawArgs) {
        const parse = ArgsSchema.safeParse(rawArgs ?? {});
        if (!parse.success) {
          return errorResult(`Invalid arguments: ${parse.error.message}`);
        }
        try {
          const { orgaoCnpj, ano, sequencial } = resolvePncpId(parse.data);
          const { numeroItem } = parse.data;
          const results = await listItemResultados(orgaoCnpj, ano, sequencial, numeroItem);
          return jsonResult({
            meta: { orgaoCnpj, ano, sequencial, numeroItem, total: results.length },
            resultados: results,
          });
        } catch (err) {
          const msg = err instanceof PncpError ? err.message : String(err);
          return errorResult(`Failed to list resultados: ${msg}`);
        }
      },
    };
  • Zod schema that extends PncpIdInputSchema with a required 'numeroItem' (positive integer) field for argument validation.
    const ArgsSchema = PncpIdInputSchema.and(
      z.object({
        numeroItem: z
          .number()
          .int()
          .positive()
          .describe('Item number within the licitação (use list_licitacao_itens first to discover).'),
      }),
    );
  • Import and registration of listLicitacaoResultados in the allTools array (line 26) and toolMap (line 49).
    import { listLicitacaoResultados } from './list_licitacao_resultados.js';
    import { listLicitacaoArquivos } from './list_licitacao_arquivos.js';
    import { searchContratos } from './search_contratos.js';
    import { getContratoTool } from './get_contrato.js';
    import { listContratoTermosTool } from './list_contrato_termos.js';
    import { listContratoInstrumentosTool } from './list_contrato_instrumentos.js';
    import { searchAtasRp } from './search_atas_rp.js';
    import { getAtaRp } from './get_ata_rp.js';
    import { getOrgaoTool } from './get_orgao.js';
    import { getFornecedorContratos } from './get_fornecedor_contratos.js';
    import { searchPca } from './search_pca.js';
    import { listPcaItensTool } from './list_pca_itens.js';
    import { getCnpjDataTool } from './get_cnpj_data.js';
    import { aggregateLicitacoes } from './aggregate_licitacoes.js';
    import { comparePeriodos } from './compare_periodos.js';
    
    export const allTools: ToolDef[] = [
      // Compras / Licitações
      searchLicitacoes,
      getLicitacao,
      listLicitacaoItens,
      listLicitacaoResultados,
      listLicitacaoArquivos,
      // Contratos
      searchContratos,
      getContratoTool,
      listContratoTermosTool,
      listContratoInstrumentosTool,
      // Atas RP
      searchAtasRp,
      getAtaRp,
      // Órgãos / Fornecedores
      getOrgaoTool,
      getFornecedorContratos,
      // PCA
      searchPca,
      listPcaItensTool,
      // CNPJ enrichment
      getCnpjDataTool,
      // Análise agregada (v0.2.0)
      aggregateLicitacoes,
      comparePeriodos,
    ];
    
    export const toolMap = new Map<string, ToolDef>(allTools.map((t) => [t.definition.name, t]));
  • Adapter function listItemResultados that makes the actual HTTP GET request to PNCP API to fetch bidding results for a specific item, with caching and error handling.
    export async function listItemResultados(
      orgaoCnpj: string,
      ano: number,
      sequencial: number,
      numeroItem: number,
    ): Promise<ResultadoItem[]> {
      const cacheKey = `list:resultados:${orgaoCnpj}:${ano}:${sequencial}:${numeroItem}`;
      const cached = cache.get<ResultadoItem[]>(cacheKey);
      if (cached) return cached;
    
      try {
        const { data } = await withRetry(() =>
          pncpClient.get(
            `/orgaos/${orgaoCnpj}/compras/${ano}/${sequencial}/itens/${numeroItem}/resultados`,
          ),
        );
        const arr = asArray(data);
        const parsed = ResultadoItemSchema.array().parse(arr);
        cache.set(cacheKey, parsed, TTL_30_MIN);
        return parsed;
      } catch (err) {
        if (err instanceof AxiosError) {
          if (err.response?.status === 404) return [];
          throw new PncpError(describeAxiosError(err), err);
        }
        throw err;
      }
    }
  • ResultadoItemSchema — Zod schema defining the shape of each bidding result object (supplier info, prices, status, etc.).
    export const ResultadoItemSchema = z
      .object({
        numeroItem: z.number().optional(),
        numeroResultado: z.number().optional(),
        ordemClassificacaoSrp: z.number().nullable().optional(),
        niFornecedor: z.string().nullable().optional(),
        tipoPessoa: z.string().nullable().optional(),
        nomeRazaoSocialFornecedor: z.string().nullable().optional(),
        porteFornecedorId: z.number().nullable().optional(),
        porteFornecedorNome: z.string().nullable().optional(),
        situacaoCompraItemResultadoId: z.number().nullable().optional(),
        situacaoCompraItemResultadoNome: z.string().nullable().optional(),
        valorUnitario: z.number().nullable().optional(),
        valorTotal: z.number().nullable().optional(),
        percentualDesconto: z.number().nullable().optional(),
        marca: z.string().nullable().optional(),
        modelo: z.string().nullable().optional(),
        dataResultado: z.string().nullable().optional(),
      })
      .passthrough();
    
    export type ResultadoItem = z.infer<typeof ResultadoItemSchema>;
Behavior2/5

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

No annotations are provided, so the description bears the full burden. It states the tool lists results, implying a read operation, but does not explicitly declare read-only behavior, auth needs, rate limits, or error handling. It lacks behavioral context beyond the purpose.

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 two sentences: first states purpose, second gives workflow guidance. No unnecessary words, front-loaded with important information. Every sentence adds value.

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?

No output schema exists, so the description should explain what is returned. It lists 'winners, runners-up, prices, suppliers' but lacks detail on format or pagination. It also assumes knowledge of the licitação identification parameters without clarifying their necessity. Given the tool's complexity (5 parameters, no output schema), the description is incomplete.

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

Parameters2/5

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

Schema description coverage is only 20% (1 of 5 parameters documented in schema). The description adds context about numeroItem being crucial and the workflow with list_licitacao_itens, but it does not explain the other four parameters (numeroControlePNCP, orgaoCnpj, ano, sequencial) that identify the licitação. It partially compensates but insufficiently.

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

Purpose5/5

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

The description clearly states the tool lists bidding results (winners, runners-up, prices, suppliers) for a specific item of a licitação. It distinguishes itself from siblings like list_licitacao_itens (which lists items) and get_licitacao (which gets the whole licitação), so purpose is clear.

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

Usage Guidelines4/5

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

The description provides explicit guidance: 'You must specify which item — use list_licitacao_itens first to discover item numbers.' This tells the agent when to use this tool (after listing items) and implies not to use it without the item number. It suggests an alternative prerequisite sibling tool, which is helpful.

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/Licinexus/licinexus-mcp'

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