Skip to main content
Glama

Gerar etiqueta (Correios)

generate_label
Destructive

Create a Correios pré-postagem and generate its shipping label (etiqueta) as a PDF. Returns the tracking code and a clickable link to the label PDF — share that link with the merchant/customer in chat so they can open/print it (it works even if Correios is still rendering). Supply invoiceKey for NF-e or declaredItems for DC-e. Requires the store's own authenticated Correios contract. Never use this tool to retry an uncertain emission or recover a PDF; use diagnose_label_issue and recover_label_pdf when available.

Input Schema

NameRequiredDescriptionDefault
senderYesRemetente (sender / store).
recipientYesDestinatário (recipient / customer).
dimensionsNoPackage dimensions in centimeters. Optional: when omitted, the store's own registered packaging box is used if it has exactly one; ask the merchant for dimensions when the store has none or more than one box registered (the call fails with reason dimensions_required_no_box / dimensions_required_multiple_boxes).
instanceIdNoMerchant/store id. Ignored on authenticated servers (the merchant comes from the API key); used only on local/unauthenticated servers.
invoiceKeyNoComplete NF-e access key (44 digits). Spaces, dots, hyphens and slashes are ignored. When supplied, emits with NF-e instead of DC-e; never invent or complete missing digits.
serviceCodeYesCorreios product code, e.g. '03220' (SEDEX) or '03298' (PAC).
weightGramsYesPackage weight in grams.
objectFormatNoObject format: '1' envelope, '2' package/box (default), '3' roll.
declaredItemsNoDeclaração de conteúdo — required when invoiceKey is omitted (at least one item). Ignored when a valid NF-e is supplied.

Output Schema

NameRequiredDescriptionDefault
reasonNoWhy the label wasn't (fully) produced.
statusNoCorreios pré-postagem status.
actionUrlNoWhen set (e.g. reason=subscription_required), send the merchant here to finish setup.
labelPdfUrlNoClickable link to download the label PDF — share this with the merchant/customer in chat. Works even before the PDF finishes rendering (it waits and streams it once ready).
supportCodeNoCódigo de atendimento para diagnose_label_issue.
trackingCodeNoCódigo de rastreamento, once the pré-postagem exists.
prepostagemIdNoCorreios pré-postagem id. Pass it to get_label_pdf to fetch the PDF later if it wasn't ready.
labelPdfBase64NoBase64-encoded label PDF, once ready.
recoveryActionNo
journalUnavailableNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed24 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / declaredItems / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / declaredItems / items / properties / quantidade / maximum
      Added value: +9007199254740991
    • removedInput schema / properties / dimensions / additionalProperties
      Removed value: -false
    • removedInput schema / properties / recipient / additionalProperties
      Removed value: -false
    • removedInput schema / properties / recipient / properties / cpfCnpj / $ref
      Removed value: -"#/properties/sender/properties/cpfCnpj"
    • addedInput schema / properties / recipient / properties / cpfCnpj / description
      Added value: +"CPF or CNPJ, digits only."
    • addedInput schema / properties / recipient / properties / cpfCnpj / type
      Added value: +"string"
    • removedInput schema / properties / recipient / properties / email / $ref
      Removed value: -"#/properties/sender/properties/email"
    • addedInput schema / properties / recipient / properties / email / description
      Added value: +"Email address."
    • addedInput schema / properties / recipient / properties / email / type
      Added value: +"string"
    • removedInput schema / properties / recipient / properties / endereco / $ref
      Removed value: -"#/properties/sender/properties/endereco"
    • addedInput schema / properties / recipient / properties / endereco / properties
      Added value: +{
      +  "bairro": {
      +    "description": "Neighborhood.",
      +    "type": "string"
      +  },
      +  "cep": {
      +    "description": "CEP (8 digits; dashes/spaces ignored).",
      +    "type": "string"
      +  },
      +  "cidade": {
      +    "description": "City.",
      +    "type": "string"
      +  },
      +  "complemento": {
      +    "description": "Address complement (apt, etc.).",
      +    "type": "string"
      +  },
      +  "logradouro": {
      +    "description": "Street name.",
      +    "type": "string"
      +  },
      +  "numero": {
      +    "description": "Street number.",
      +    "type": "string"
      +  },
      +  "uf": {
      +    "description": "Two-letter state, e.g. 'SP'.",
      +    "maxLength": 2,
      +    "minLength": 2,
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / recipient / properties / endereco / required
      Added value: +[
      +  "cep",
      +  "logradouro",
      +  "numero",
      +  "bairro",
      +  "cidade",
      +  "uf"
      +]
    • addedInput schema / properties / recipient / properties / endereco / type
      Added value: +"object"
    • removedInput schema / properties / recipient / properties / nome / $ref
      Removed value: -"#/properties/sender/properties/nome"
    • addedInput schema / properties / recipient / properties / nome / description
      Added value: +"Full name or company name."
    • addedInput schema / properties / recipient / properties / nome / type
      Added value: +"string"
    • removedInput schema / properties / recipient / properties / telefone / $ref
      Removed value: -"#/properties/sender/properties/telefone"
    • addedInput schema / properties / recipient / properties / telefone / description
      Added value: +"Phone number."
    • addedInput schema / properties / recipient / properties / telefone / type
      Added value: +"string"
    • removedInput schema / properties / sender / additionalProperties
      Removed value: -false
    • removedInput schema / properties / sender / properties / endereco / additionalProperties
      Removed value: -false
    • addedOutput schema / properties / supportCode / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag destructive/openWorld/non-idempotent, and the description adds materially: the label link works even while Correios is still rendering (so the agent should share it rather than poll), and the store must have its own authenticated contract. The anti-retry warning is exactly the kind of safety context annotations cannot express.

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?

Four sentences, front-loaded with what it creates and what it returns, then the sharing instruction, then the conditional params, then the anti-pattern. No sentence is filler.

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

Completeness5/5

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

For a destructive, non-idempotent, open-world mutation with 9 params, nested objects and an output schema, the description covers purpose, return contract, sharing behavior, prerequisites and failure alternatives. Nothing an agent needs to invoke it correctly is missing.

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 100%, so the schema already documents every parameter including the dimensions-fallback and NF-e/DC-e rules. The description's 'Supply invoiceKey for NF-e or declaredItems for DC-e' restates what the schema already states, so it adds little beyond the baseline.

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?

Specific verb+resource ('Create a Correios pré-postagem and generate its shipping label as a PDF') plus the concrete artifact returned (tracking code + PDF link). It explicitly names the sibling tools it is not (diagnose_label_issue, recover_label_pdf), so an agent can distinguish it without opening any schema.

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

Usage Guidelines5/5

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

Explicit when-not guidance: 'Never use this tool to retry an uncertain emission or recover a PDF; use diagnose_label_issue and recover_label_pdf when available.' It also gives a conditional branch for invoiceKey vs declaredItems and a prerequisite (store's authenticated Correios contract).

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.