Skip to main content
Glama

Criar alerta

criar_alerta

Alerta de compra nova por termos do objeto e UF (precisa do token edm_…). Canal pull (ler por alertas_compras), webhook (POST https assinado com o whsec_… do dono) ou email (só com a sessão da conta: vai para o e-mail verificado dela). O primeiro é grátis; os seguintes custam por 30 dias (x402 ou crédito). 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)
canalNopull, webhook ou email (padrão pull)pull
termosYesPalavras do objeto, 3 a 200 letras; espaço = todas, | = qualquer uma (uniforme|fardamento)
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.

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. Changed2 schema fields changed
    • addedInput schema / properties / canal / default
      Added value: +"pull"
    • addedInput schema / properties / canal / enum
      Added value: +[
      +  "pull",
      +  "webhook",
      +  "email"
      +]
  5. First observed

TDQS

A3.9/5.0
Behavior5/5

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

Annotations only declare it is a non-read-only, non-idempotent, non-destructive write. The description goes well beyond that, disclosing pricing/quota mechanics (FRANQUIA_ALERTAS free first alert, PRECO_ALERTA per 30 days, single N× charge in CNPJ mode), required tokens (edm_, whsec_), session requirement for email, EMAIL_ALERTAS=1 gating, and the 30-minute cron cadence.

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

Conciseness3/5

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

Front-loaded with the core purpose, but the text is dense and repeats the pricing rule twice ('O primeiro é grátis… os seguintes custam' appearing early and again in detail), and it mixes duas-modos, channels and billing in one long paragraph. Length is partly justified by complexity but not every sentence earns its place.

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?

For a 5-parameter tool with a nested filtros object and no output schema, the description covers the essential operational context: channels, prerequisites, billing and the CNPJ edge case (CNAE fora do dicionário → familia null). It is nearly complete, though it does not describe what the creation response returns (alert id, status).

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 100%, so the baseline is 3, and the description adds semantic depth: termos syntax (space = all words, '|' = any, with example), canal semantics including that destino is ignored for pull/email, and the CNPJ family-generation logic with max_familias and empresa.cnaes output. It clarifies behavior the schema alone does not.

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?

Specific verb ('criar') plus resource ('alerta') and a precise scope: purchase alerts by object terms and UF, with three delivery channels and two modes (termos/cnpj). It's clearly actionable, but it never names or routes away from plausible siblings like alerta_por_cnpj or previa_alerta, which its CNPJ-mode narrative actually overlaps.

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?

Usage context is implied through channel behavior (pull/webhook/email requirements) and the CNPJ-mode explanation, but there is no explicit 'use this when… / use X instead' guidance versus the closely related siblings (editar_alerta, previa_alerta, alerta_por_cnpj). The agent must infer 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