Skip to main content
Glama

Cancel Envia Shipment

envia_cancel
Destructive

Cancel a shipment and request a refund; confirm with the user first because the cancellation cannot be undone.

Instructions

Cancel a shipment and request a refund. This is a DESTRUCTIVE operation.

WARNING: Cancellation cannot be undone. Confirm with the user before proceeding. If the shipment is already canceled, error 1115 will be returned.

Args: carrier — Carrier string (e.g., "dhl", "fedex", "estafeta") tracking_number — Tracking number of the shipment to cancel response_format — "markdown" (default) or "json"

Returns: Cancellation status, refunded amount, and balance return info.

Errors: 1115 — Shipment is already canceled 400 — Invalid carrier or tracking number 403 — Invalid API key

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": {
      "carrier": "<carrier>",
      "tracking_number": "<tracking_number>"
    },
    "name": "envia_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
carrierYesCarrier string (e.g., "dhl")
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown
tracking_numberYesTracking number of the shipment to cancel

Output Schema

NameRequiredDescriptionDefault
statusYes
carrierYes
refunded_amountYes
tracking_numberYes
balance_returnedYes
balance_return_dateYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, and the description reinforces those with concrete consequences: cancellation is irreversible, a confirmation step is expected, and a repeat call yields error 1115 (consistent with the non-idempotent hint). It also names expected return fields (status, refunded amount, balance return). The 'DESTRUCTIVE' restatement and Args block partially duplicate structured data, keeping it from a 5.

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?

The warning is front-loaded before mechanics, and the Args/Returns/Errors breakdown is easy to scan. The Args section is largely redundant with a fully documented schema, which is the main wasted space; the Returns section is also partly redundant given an output schema exists.

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, open-world mutation, the description supplies the missing decision-critical context: irreversibility, user confirmation, and a mapped error table (1115, 400, 403) that tells the agent how to react to failures. Return values need not be elaborated further because an output schema exists.

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%, and the Args section restates the same carrier and tracking_number text nearly verbatim, adding carrier examples ('dhl', 'fedex', 'estafeta') that are only marginally beyond the schema's single example. No additional constraints such as format expectations for tracking numbers or carrier-specific requirements are supplied.

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?

States a specific verb and resource ('Cancel a shipment') plus the secondary effect ('request a refund'), which is exactly what an agent needs to distinguish it from label creation, quoting, or tracking siblings. No other sibling appears to cancel, and the description makes that scope unambiguous.

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?

Gives clear conditions for use (a shipment exists and should be canceled) and adds an explicit procedural guardrail: 'Confirm with the user before proceeding.' It also covers the already-canceled case up front. It does not name alternatives, but within this sibling set there is no plausible alternative cancellation path to route to.

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