Skip to main content
Glama
Licinexus

licinexus-mcp

Official
by Licinexus

search_pca

Search recent PCA entries from Brazilian public agencies to see what they intend to buy. Filter by classification 'material' or 'servico' and date range.

Instructions

Search recently published/updated Plano de Contratação Anual (PCA) entries — what public agencies INTEND to buy. Returns PCA entries (one per agency unit) with their items embedded. Filter by classification: 'material' or 'servico'. Defaults: last 30 days, classification 'material'. Per Lei 14.133. Maximum date range per query: 365 days (PNCP limit).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataInicioNoStart date YYYYMMDD. Default: 30 days ago.
dataFimNoEnd date YYYYMMDD. Default: today.
classificacaoNoTop-level classification: material (codigoClassificacaoSuperior=01) or servico (=02).material
paginaNo
tamanhoPaginaNo

Implementation Reference

  • The ToolDef definition for 'search_pca'. Contains both the input schema (dataInicio, dataFim, classificacao, pagina, tamanhoPagina) and the async handler function that parses arguments, validates dates, calls listPcaAtualizacao, and returns results with meta information.
    export const searchPca: ToolDef = {
      definition: {
        name: 'search_pca',
        description:
          `Search recently published/updated Plano de Contratação Anual (PCA) entries — what public agencies INTEND to buy. Returns PCA entries (one per agency unit) with their items embedded. Filter by classification: 'material' or 'servico'. Defaults: last 30 days, classification 'material'. Per Lei 14.133. Maximum date range per query: ${PNCP_MAX_DATE_RANGE_DAYS} days (PNCP limit).`,
        inputSchema: {
          type: 'object',
          properties: {
            dataInicio: {
              type: 'string',
              description: 'Start date YYYYMMDD. Default: 30 days ago.',
            },
            dataFim: { type: 'string', description: 'End date YYYYMMDD. Default: today.' },
            classificacao: {
              type: 'string',
              enum: ['material', 'servico'],
              default: 'material',
              description:
                'Top-level classification: material (codigoClassificacaoSuperior=01) or servico (=02).',
            },
            pagina: { type: 'integer', minimum: 1, default: 1 },
            tamanhoPagina: { type: 'integer', minimum: 10, maximum: 50, default: 20 },
          },
        },
      },
    
      async handler(rawArgs) {
        const parse = ArgsSchema.safeParse(rawArgs ?? {});
        if (!parse.success) return errorResult(`Invalid arguments: ${parse.error.message}`);
        const args = parse.data;
        const range =
          !args.dataInicio || !args.dataFim
            ? (() => {
                const r = defaultDateRange(30);
                return { dataInicio: r.dataInicial, dataFim: r.dataFinal };
              })()
            : { dataInicio: args.dataInicio, dataFim: args.dataFim };
    
        const validation = validatePncpDateRange(range.dataInicio, range.dataFim);
        if (!validation.ok) {
          return errorResult(validation.reason);
        }
    
        try {
          const page = await listPcaAtualizacao({
            dataInicio: range.dataInicio,
            dataFim: range.dataFim,
            codigoClassificacaoSuperior: args.classificacao === 'servico' ? '02' : '01',
            pagina: args.pagina,
            tamanhoPagina: args.tamanhoPagina,
          });
          return jsonResult({
            meta: {
              dataInicio: range.dataInicio,
              dataFim: range.dataFim,
              classificacao: args.classificacao,
              pagina: args.pagina,
              totalRetornados: page.data.length,
              totalPncp: page.totalRegistros,
              totalPaginas: page.totalPaginas,
            },
            results: page.data,
          });
        } catch (err) {
          const msg = err instanceof PncpError ? err.message : String(err);
          return errorResult(`Failed to search PCA: ${msg}`);
        }
      },
    };
  • Zod schema (ArgsSchema) for validating tool input parameters: dataInicio, dataFim (optional YYYYMMDD strings), classificacao (enum material/servico), pagina, tamanhoPagina.
    const ArgsSchema = z.object({
      dataInicio: z.string().refine(isValidPncpDate, 'Format must be YYYYMMDD').optional(),
      dataFim: z.string().refine(isValidPncpDate, 'Format must be YYYYMMDD').optional(),
      classificacao: z.enum(['material', 'servico']).default('material'),
      pagina: z.number().int().min(1).default(1),
      tamanhoPagina: z.number().int().min(10).max(50).default(20),
    });
  • MCP Tool inputSchema definition (JSON Schema) for 'search_pca' tool, describing the same parameters for MCP protocol compatibility.
    definition: {
      name: 'search_pca',
      description:
        `Search recently published/updated Plano de Contratação Anual (PCA) entries — what public agencies INTEND to buy. Returns PCA entries (one per agency unit) with their items embedded. Filter by classification: 'material' or 'servico'. Defaults: last 30 days, classification 'material'. Per Lei 14.133. Maximum date range per query: ${PNCP_MAX_DATE_RANGE_DAYS} days (PNCP limit).`,
      inputSchema: {
        type: 'object',
        properties: {
          dataInicio: {
            type: 'string',
            description: 'Start date YYYYMMDD. Default: 30 days ago.',
          },
          dataFim: { type: 'string', description: 'End date YYYYMMDD. Default: today.' },
          classificacao: {
            type: 'string',
            enum: ['material', 'servico'],
            default: 'material',
            description:
              'Top-level classification: material (codigoClassificacaoSuperior=01) or servico (=02).',
          },
          pagina: { type: 'integer', minimum: 1, default: 1 },
          tamanhoPagina: { type: 'integer', minimum: 10, maximum: 50, default: 20 },
        },
      },
    },
  • Import of searchPca from search_pca.ts.
    import { searchPca } from './search_pca.js';
  • Registration of searchPca in the allTools array, which is later exported as toolMap for MCP tool discovery.
    // PCA
    searchPca,
Behavior3/5

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

No annotations provided, so description bears full burden. It discloses filtering options, defaults, and a date range limit. However, it omits behavioral details like pagination behavior, response format (beyond 'items embedded'), and potential rate limits, which are important for an agent.

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

Conciseness4/5

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

Single paragraph with clear front-loading of purpose and key details. No redundant sentences. Efficient use of words, though could be slightly more structured.

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?

No output schema or annotations, so description must cover more. It covers purpose, filtering, defaults, and limits. But lacks explanation of pagination, error handling, or output structure beyond items. Adequate but not comprehensive.

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?

Input schema has 5 parameters with 60% coverage. Description adds meaning to 'classificacao' (top-level classification) and notes date defaults and max range. It does not explain 'pagina' or 'tamanhoPagina' beyond what schema provides. With moderate schema coverage, description partially compensates.

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 searches recently published/updated PCA entries, explains what PCA is (public agencies' intended purchases), and specifies it returns entries with embedded items. It distinguishes from siblings like 'search_licitacoes' and 'list_pca_itens' by focusing on PCA entries.

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?

Provides explicit context for when to use: to see what agencies intend to buy. States defaults (last 30 days, classification 'material') and a key constraint (max 365-day range). Lacks direct comparison to sibling tools or explicit when-not-to-use, but the context is clear.

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