Skip to main content
Glama

Alerta por CNPJ

alerta_por_cnpj

Alertas de compra nova pelo CNPJ da empresa (precisa do token edm_…): as atividades (CNAE) viram famílias de termos e sai um alerta por família, principal primeiro, até max_familias. O que passa da franquia é cobrado numa vez só (x402 ou crédito). CNAE fora do dicionário vem listado na resposta com familia nula. Dois modos. Por termos: espaço exige todas as palavras, | aceita qualquer uma do grupo (uniforme|fardamento escolar). Por cnpj: o cadastro da empresa informa as atividades (CNAE), o dicionário (GET /api/cnaes) transforma cada CNAE numa família de termos e sai um alerta por família distinta, principal primeiro, até max_familias; CNAE fora do dicionário não vira alerta e é listado em empresa.cnaes com familia: null. O primeiro alerta ativo é grátis (FRANQUIA_ALERTAS); os seguintes custam PRECO_ALERTA por 30 dias cada — no modo CNPJ, numa cobrança só (N × preço), por x402 ou crédito. O cron confere a cada 30 minutos. Canal e-mail exige a sessão da conta — o aviso vai para o e-mail verificado dela, sem código de confirmação — e só existe com EMAIL_ALERTAS=1.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoSigla da UF (opcional)
cnpjYesCNPJ com 14 dígitos, com ou sem pontuação
canalNopull, webhook ou email (padrão pull)pull
destinoNoURL https (webhook); ignorado no pull e no email (vai para o e-mail da conta)
filtrosNoRecorte adicional: modalidades, municípios, exclusões, valores, propostas abertas e CNAEs. PATCH substitui o recorte inteiro; {} limpa.
max_familiasNo1 a 8 (padrão 8): quantas famílias viram alerta

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / filtros / description
      Previous value: -"Recorte adicional: modalidades, municípios, exclusões, valores e propostas abertas. PATCH substitui o recorte inteiro; {} limpa."New value: +"Recorte adicional: modalidades, municípios, exclusões, valores, propostas abertas e CNAEs. PATCH substitui o recorte inteiro; {} limpa."
    • addedInput schema / properties / filtros / properties / cnaes
      Added value: +{
      +  "items": {
      +    "pattern": "^\\d{4}-?\\d/?\\d{2}$",
      +    "type": "string"
      +  },
      +  "maxItems": 8,
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / destino / description
      Previous value: -"URL https (webhook) ou e-mail (email)"New value: +"URL https (webhook); ignorado no pull e no email (vai para o e-mail da conta)"
  3. Changed1 schema field changed
    • addedInput schema / properties / filtros
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Recorte adicional: modalidades, municípios, exclusões, valores e propostas abertas. PATCH substitui o recorte inteiro; {} limpa.",
      +  "properties": {
      +    "abertas": {
      +      "type": "boolean"
      +    },
      +    "excluir": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "maxItems": 10,
      +      "type": "array"
      +    },
      +    "modalidades": {
      +      "items": {
      +        "maximum": 13,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "maxItems": 10,
      +      "type": "array"
      +    },
      +    "municipios": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "maxItems": 10,
      +      "type": "array"
      +    },
      +    "valor_max": {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "valor_min": {
      +      "minimum": 0,
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  4. Changed3 schema fields changed
    • addedInput schema / properties / canal / default
      Added value: +"pull"
    • addedInput schema / properties / canal / enum
      Added value: +[
      +  "pull",
      +  "webhook",
      +  "email"
      +]
    • addedInput schema / properties / max_familias / default
      Added value: +8
  5. First observed

TDQS

A3.8/5.0
Behavior5/5

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

Annotations only flag it as a non-idempotent write with no destructive effect; the description goes far beyond that, disclosing the edm_ token requirement, franchise/price billing via x402 or credit (single N× charge in CNPJ mode), the 30-minute cron, and the email-channel account-session plus EMAIL_ALERTAS=1 gating. This is unusually rich behavioral disclosure for a write tool.

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

Conciseness2/5

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

The CNAE→família mechanism is fully restated twice within one description, and an irrelevant `termos` mode (not in the schema) occupies substantial space. Purpose is front-loaded but the redundancy wastes the reader's attention.

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

Completeness4/5

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

With no output schema and six parameters, the description still covers the crucial behavioral surface (token, billing, cadence, channel constraints) and even the one notable response field (empresa.cnaes with familia:null). The alert return shape itself is not described, but the operational gaps an agent would hit are largely closed.

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

Parameters4/5

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

Schema description coverage is already 100%, so the baseline is 3, but the text adds real meaning: max_familias determines how many families become alerts (principal first), and canal=email routes to the verified account email with no confirmation code. It does not clarify uf, destino, or the nested filtros fields beyond the schema.

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?

States a specific resource and keying (new purchase alerts keyed by company CNPJ), which is enough for an agent to know what it does. However it never explicitly differentiates itself from close siblings like criar_alerta, previa_alerta or alertas_compras, so the distinction must be inferred.

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?

It explains two operating modes and the financial/cadence conditions, which implies when it is appropriate, but there is no explicit when-to-use-vs-alternative guidance. The referenced `termos` mode is not present in this tool's schema, which muddies rather than clarifies routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources