Skip to main content
Glama
Licinexus

licinexus-mcp

Official
by Licinexus

list_pca_itens

List items in a Brazilian annual procurement plan (PCA) with quantities, values, delivery dates, and CATSER/CATMAT classification. Filter by keyword on description.

Instructions

List the planned items of a specific PCA: descriptions, estimated quantities, unit values, expected delivery dates, and CATSER/CATMAT classification. Optionally filter client-side by keyword on description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgaoCnpjYes
anoPcaYes
sequencialPcaYes
palavraChaveNoFilter on descricaoItem

Implementation Reference

  • The handler function that executes the list_pca_itens tool logic: parses input (orgaoCnpj, anoPca, sequencialPca, optional palavraChave), calls the adapter to fetch PCA items, applies optional keyword filtering, and returns the results with metadata.
    async handler(rawArgs) {
      const parse = ArgsSchema.safeParse(rawArgs ?? {});
      if (!parse.success) return errorResult(`Invalid arguments: ${parse.error.message}`);
      const args = parse.data;
      try {
        const cnpj = normalizeCnpj(args.orgaoCnpj);
        const itens = await listPcaItens(cnpj, args.anoPca, args.sequencialPca);
        const filtered = args.palavraChave
          ? itens.filter((i) =>
              (i.descricaoItem ?? '').toLowerCase().includes(args.palavraChave!.toLowerCase()),
            )
          : itens;
        return jsonResult({
          meta: {
            orgaoCnpj: cnpj,
            anoPca: args.anoPca,
            sequencialPca: args.sequencialPca,
            total: filtered.length,
            totalAntesFiltro: itens.length,
          },
          itens: filtered,
        });
      } catch (err) {
        const msg = err instanceof PncpError ? err.message : String(err);
        return errorResult(`Failed to list PCA itens: ${msg}`);
      }
    },
  • The adapter function listPcaItens that makes the HTTP GET request to /orgaos/{cnpj}/pca/{ano}/{sequencial}/itens, caches the result with a 30-min TTL, and parses using PcaItemSchema.
    export async function listPcaItens(
      orgaoCnpj: string,
      anoPca: number,
      sequencialPca: number,
    ): Promise<PcaItem[]> {
      const cacheKey = `list:pca-itens:${orgaoCnpj}:${anoPca}:${sequencialPca}`;
      const cached = cache.get<PcaItem[]>(cacheKey);
      if (cached) return cached;
    
      try {
        const { data } = await withRetry(() =>
          pncpClient.get(`/orgaos/${orgaoCnpj}/pca/${anoPca}/${sequencialPca}/itens`),
        );
        const arr = asArray(data);
        const parsed = PcaItemSchema.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;
      }
    }
  • PcaItemSchema: Zod schema defining each PCA item's fields (description, quantities, unit values, classification, dates, etc.) with passthrough for extra fields.
    export const PcaItemSchema = z
      .object({
        orgaoCnpj: z.string().nullable().optional(),
        anoPca: z.number().nullable().optional(),
        codigoUnidade: z.string().nullable().optional(),
        nomeUnidade: z.string().nullable().optional(),
        numeroItem: z.number().nullable().optional(),
        codigoItem: z.string().nullable().optional(),
        descricaoItem: z.string().nullable().optional(),
        quantidadeEstimada: z.number().nullable().optional(),
        valorUnitario: z.number().nullable().optional(),
        valorTotal: z.number().nullable().optional(),
        valorOrcamentoExercicio: z.number().nullable().optional(),
        classificacaoCatalogoId: z.number().nullable().optional(),
        classificacaoSuperiorCodigo: z.string().nullable().optional(),
        classificacaoSuperiorNome: z.string().nullable().optional(),
        grupoContratacaoCodigo: z.string().nullable().optional(),
        grupoContratacaoNome: z.string().nullable().optional(),
        categoriaItemPcaNome: z.string().nullable().optional(),
        unidadeRequisitante: z.string().nullable().optional(),
        unidadeFornecimento: z.string().nullable().optional(),
        dataDesejada: z.string().nullable().optional(),
      })
      .passthrough();
  • ArgsSchema: Zod schema for tool input validation of orgaoCnpj, anoPca, sequencialPca, and optional palavraChave.
    const ArgsSchema = z.object({
      orgaoCnpj: z.string(),
      anoPca: z.number().int(),
      sequencialPca: z.number().int(),
      palavraChave: z.string().min(2).optional(),
    });
  • Registration of listPcaItensTool in the allTools array (line 41) and export of the toolMap at line 49.
      listPcaItensTool,
      // CNPJ enrichment
      getCnpjDataTool,
      // Análise agregada (v0.2.0)
      aggregateLicitacoes,
      comparePeriodos,
    ];
Behavior3/5

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

No annotations are present, so the description carries the burden. The word 'list' implies a read-only operation, and the description adds that filtering is client-side. However, it does not disclose other behavioral traits such as pagination, rate limits, or authentication requirements.

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 very concise, with two sentences front-loading the purpose and then adding the filter option. No extraneous information.

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

Completeness3/5

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

The description lists the returned fields, which is helpful without an output schema. However, it omits typical completeness aspects like pagination, error handling, or data format details. Given the tool is one of many list tools, more context would improve completeness.

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 low (25% only for palavraChave). The description explains the optional filter parameter but does not elaborate on the meaning or format of the three required parameters (orgaoCnpj, anoPca, sequencialPca), relying on their names which are somewhat descriptive but not fully explanatory.

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 verb 'list' and the resource 'planned items of a specific PCA', specifying the fields returned (descriptions, quantities, values, dates, classifications). This distinguishes it from sibling tools like list_licitacao_itens which deal with different entities.

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

Usage Guidelines3/5

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

The description mentions optional client-side filtering but does not provide explicit guidance on when to use this tool versus alternatives like list_licitacao_itens or search_pca. The context of PCA items is implicit but not contrasted with other list endpoints.

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