Skip to main content
Glama

Alerts by CNPJ

create_alerts_by_cnpj

Alerts for new procurements by the company CNPJ (requires the token edm_…): the activities (CNAE) become families of terms, and there is one alert per family, main first, up to max_familias. A CNAE outside the dictionary is listed in the response with a null family. Two modes. By termos: a space requires all groups; | accepts alternatives within a group. By cnpj: known activity families produce alerts, up to max_familias. Unmapped activities remain in the response without an alert. The cron checks every 30 minutes. Email requires an account session and EMAIL_ALERTAS=1. It uses explicit recipients or the verified account email.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cnpj": "<cnpj>"
    },
    "name": "create_alerts_by_cnpj"
  }
}

Input Schema

NameRequiredDescriptionDefault
ufNoState (UF) abbreviation (optional).
cnpjYesCNPJ with 14 digits, with or without punctuation.
nomeNoAlert name, up to 100 characters.
canalNopull, webhook or email (default pull).pull
destinoNoHTTPS webhook URL. Ignored for pull and email.
filtrosNoExtra filter: modalities, municipalities, exclusions, values, open proposals and CNAEs. PATCH replaces the whole filter; {} clears it.
resultadosNoAlso deliver the result of each matching purchase when PNCP publishes it, on the same channel: the purchase comes back once with `resultado` (awarded value, items, date and the three largest winners). It starts when turned on, without past results. `abertas` does not apply to results.
max_familiasNo1 to 8 (default 8): how many families become alerts.
destinatariosNoEmail recipients: `para`, `cc` and `bcc` arrays. Up to 10 distinct addresses in total. An empty `para` list uses the account email. PATCH replaces all three lists. BCC is hidden from other recipients.
organizacao_idNoOrganization from `GET /api/me/empresas`. Membership and MFA are checked. Null removes the label. This does not share alert ownership.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changed
    • addedInput schema / properties / destinatarios / properties / bcc / description
      Added value: +"Hidden copy addresses. Only the alert owner can read this list."
    • addedInput schema / properties / destinatarios / properties / cc / description
      Added value: +"Visible copy addresses."
    • addedInput schema / properties / destinatarios / properties / para / description
      Added value: +"To addresses. An empty list uses the verified account email."
    • addedInput schema / properties / filtros / properties / abertas / description
      Added value: +"Require the proposal deadline to be open at collection time."
    • addedInput schema / properties / filtros / properties / cnaes / description
      Added value: +"Up to 8 CNAE subclasses, such as 4644301 or 4644-3/01. Matches one of the purchase's three most likely CNAEs."
    • addedInput schema / properties / filtros / properties / disputa / description
      Added value: +"Only purchases with competitive bidding. Excludes PNCP's not-applicable bidding mode."
    • addedInput schema / properties / filtros / properties / esferas / description
      Added value: +"Government spheres: F federal, E state, D district and M municipal. Records without a sphere are excluded."
    • addedInput schema / properties / filtros / properties / excluir / description
      Added value: +"Up to 10 literal phrases, each 3–80 characters, to exclude from the purchase subject."
    • addedInput schema / properties / filtros / properties / modalidades / description
      Added value: +"Up to 10 PNCP procedure codes, from 1 to 19."
    • addedInput schema / properties / filtros / properties / municipios / description
      Added value: +"Up to 10 exact municipality names or IBGE codes. Use UF to distinguish names."
    • addedInput schema / properties / filtros / properties / srp / description
      Added value: +"Only purchases marked as price registration (srp) by PNCP."
    • addedInput schema / properties / filtros / properties / valor_max / description
      Added value: +"Maximum estimated value in Brazilian reais."
    • addedInput schema / properties / filtros / properties / valor_min / description
      Added value: +"Minimum estimated value in Brazilian reais."
  2. Changed4 schema fields changed
    • addedInput schema / properties / filtros / properties / disputa
      Added value: +{
      +  "type": "boolean"
      +}
    • addedInput schema / properties / filtros / properties / esferas
      Added value: +{
      +  "items": {
      +    "enum": [
      +      "F",
      +      "E",
      +      "D",
      +      "M"
      +    ],
      +    "type": "string"
      +  },
      +  "maxItems": 10,
      +  "type": "array"
      +}
    • addedInput schema / properties / filtros / properties / srp
      Added value: +{
      +  "type": "boolean"
      +}
    • addedInput schema / properties / resultados
      Added value: +{
      +  "description": "Also deliver the result of each matching purchase when PNCP publishes it, on the same channel: the purchase comes back once with `resultado` (awarded value, items, date and the three largest winners). It starts when turned on, without past results. `abertas` does not apply to results.",
      +  "type": "boolean"
      +}
  3. Changed4 schema fields changed
    • addedInput schema / properties / destinatarios
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Email recipients: `para`, `cc` and `bcc` arrays. Up to 10 distinct addresses in total. An empty `para` list uses the account email. PATCH replaces all three lists. BCC is hidden from other recipients.",
      +  "properties": {
      +    "bcc": {
      +      "items": {
      +        "format": "email",
      +        "maxLength": 254,
      +        "type": "string"
      +      },
      +      "maxItems": 10,
      +      "type": "array"
      +    },
      +    "cc": {
      +      "items": {
      +        "format": "email",
      +        "maxLength": 254,
      +        "type": "string"
      +      },
      +      "maxItems": 10,
      +      "type": "array"
      +    },
      +    "para": {
      +      "items": {
      +        "format": "email",
      +        "maxLength": 254,
      +        "type": "string"
      +      },
      +      "maxItems": 10,
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedInput schema / properties / destino / description
      Previous value: -"https URL (webhook); ignored for pull and email (email goes to the account e-mail)."New value: +"HTTPS webhook URL. Ignored for pull and email."
    • addedInput schema / properties / nome
      Added value: +{
      +  "description": "Alert name, up to 100 characters.",
      +  "maxLength": 100,
      +  "type": "string"
      +}
    • addedInput schema / properties / organizacao_id
      Added value: +{
      +  "description": "Organization from `GET /api/me/empresas`. Membership and MFA are checked. Null removes the label. This does not share alert ownership.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  4. Added

TDQS

A3.5/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnly=false, destructive=false, openWorld=true, non-idempotent), and the description adds genuinely useful context beyond them: a 30-minute cron evaluation, the edm_ token requirement, that email needs an account session plus EMAIL_ALERTAS=1, and that unmapped CNAEs return a null family. The main gap is that nothing is said about what the creation response contains or how the per-family alerts are identified afterwards.

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?

Every sentence contains information, but the ordering is scattered: it opens with family mechanics, detours into a `termos` mode, then appends cron and email prerequisites at the end. The front-loaded material an agent needs (what it creates, required CNPJ, token) is split across the first and last third.

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?

This is a ten-parameter mutation tool with nested objects and no output schema, so the description carries real weight. It covers family behavior, scheduling, and email prerequisites, but leaves the response format, the effect of canal=pull vs webhook, and organization_id entirely to the schema, and it never reconciles the phantom `termos` mode with the actual CNPJ-only input.

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 coverage is 100%, so the baseline is 3 and the schema already documents all ten parameters including nested filters and recipients. The description adds meaning for max_familias and the family mapping, but spends its parameter-focused prose on `termos`, which is not a parameter of this tool, so the net added value is modest and partly misleading.

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?

The description states a specific verb and resource ('Alerts for new procurements by the company CNPJ') and explains the distinctive CNAE-to-family fan-out, which an agent could not infer from the name. It is docked one point because it introduces a 'By `termos`' mode that has no corresponding parameter in the schema, muddying what this specific tool actually does.

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 rather than stated: the cron cadence, the token requirement, and the email prerequisites tell the agent the operational setting, but there is no explicit guidance on when to pick this over siblings such as create_alert, preview_alert or update_alert. The 'Two modes' framing suggests a choice the agent cannot actually make through this schema.

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.