Skip to main content
Glama

Create Order

tronsave_create_order

Create a buy order for ENERGY/BANDWIDTH delegated to orderReceiver. SPENDS FUNDS — confirm the plan with the user first. API-key integrations paying from the internal balance can instead use tronsave_internal_order_create (FAST/MEDIUM/SLOW pricing, fill guards). Inputs: orderResourceType, orderReceiver, orderUnitPrice (SUN, not TRX), orderDurationSec, orderResourceAmount, paymentPaymentAmount (SUN), and paymentMethod: internal — debits the TronSave internal balance (needs an api-key login/header or a signature login whose wallet has an internal account); onchain — no login needed, but paymentSignedTx must be the user's wallet-signed TRX transfer to systemDepositAddress. Take price/amount/duration values from the latest tronsave_estimate_buy_resource. Returns { success, message, code, data.orderId } — check success; verify with tronsave_get_order or tronsave_list_orders. Not idempotent: on a timeout, verify before retrying to avoid duplicate orders.

Input Schema

NameRequiredDescriptionDefault
orderReceiverYesTRON base58 address (starts with T) that receives delegated resource. Same as `receiver` passed to `tronsave_estimate_buy_resource`.
paymentMethodYesPayment method for this order: `onchain` (wallet signed tx) or `internal` (internal balance).
orderUnitPriceYesUnit price in SUN per resource unit (NOT TRX). Use `unitPrice` from the latest `tronsave_estimate_buy_resource` for the same receiver, amount, and duration.
paymentSignedTxNoRequired when `paymentMethod=onchain`: the user's wallet-signed TRX transfer of `paymentPaymentAmount` SUN to `systemDepositAddress` (from `tronsave_estimate_buy_resource`), TronWeb shape `{ txID, raw_data, raw_data_hex, signature[] }`. Must be produced client-side by the user's wallet; never fabricate or hand-edit.
orderDurationSecYesDelegation duration in seconds. Must match the `durationSec` used in `tronsave_estimate_buy_resource`.
orderResourceTypeYesResource to buy: ENERGY (smart contracts) or BANDWIDTH (transactions). Must match `tronsave_estimate_buy_resource`.
orderResourceAmountYesAmount of ENERGY or BANDWIDTH units to purchase. Same as `buyResourceAmount` in estimate when applicable.
paymentPaymentAmountYesTotal payment in SUN (1 TRX = 1e6 SUN). Use `estimateTrx` (SUN) from the latest `tronsave_estimate_buy_resource`.

Output Schema

NameRequiredDescriptionDefault
codeNoGraphQL mutation status code (HTTP-like; `0`/`200` indicates success). Always pair with `success` for routing.
dataNo
messageNoHuman-readable status text. Populated even on success; localized error messages may appear here on failure.
successNoWhether the mutation succeeded at the backend level. Always check this before reading `data`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed20 schema fields changed
    • addedInput schema / properties / orderDurationSec / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / orderDurationSec / type
      Previous value: -"number"New value: +"integer"
    • removedInput schema / properties / orderReceiver / minLength
      Removed value: -1
    • addedInput schema / properties / orderReceiver / pattern
      Added value: +"^T[1-9A-HJ-NP-Za-km-z]{33}$"
    • addedInput schema / properties / orderResourceAmount / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / orderResourceAmount / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / orderUnitPrice / description
      Previous value: -"Unit price in SUN. Prefer aligning with `minResourcePrice` or `buyResourcePrice` from the latest `tronsave_estimate_buy_resource` for the same receiver, amount, and duration."New value: +"Unit price in SUN per resource unit (NOT TRX). Use `unitPrice` from the latest `tronsave_estimate_buy_resource` for the same receiver, amount, and duration."
    • changedInput schema / properties / paymentPaymentAmount / description
      Previous value: -"Payment amount in SUN. Prefer deriving from `tronsave_estimate_buy_resource`; if converting to TRX, divide SUN by `1e6`."New value: +"Total payment in SUN (1 TRX = 1e6 SUN). Use `estimateTrx` (SUN) from the latest `tronsave_estimate_buy_resource`."
    • changedInput schema / properties / paymentSignedTx / description
      Previous value: -"Required when `paymentMethod=onchain`. TronWeb-shaped signed TRON transaction (`{ txID, raw_data, raw_data_hex, signature[] }`). Must be produced client-side by the user's wallet; never fabricate or hand-edit."New value: +"Required when `paymentMethod=onchain`: the user's wallet-signed TRX transfer of `paymentPaymentAmount` SUN to `systemDepositAddress` (from `tronsave_estimate_buy_resource`), TronWeb shape `{ txID, raw_data, raw_data_hex, signature[] }`. Must be produced client-side by the user's wallet; never fabricate or hand-edit."
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +{}
    • addedOutput schema / properties / code / anyOf
      Added value: +[
      +  {
      +    "description": "GraphQL mutation status code (HTTP-like; `0`/`200` indicates success). Always pair with `success` for routing.",
      +    "maximum": 9007199254740991,
      +    "minimum": -9007199254740991,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / code / maximum
      Removed value: -9007199254740991
    • removedOutput schema / properties / code / minimum
      Removed value: --9007199254740991
    • removedOutput schema / properties / code / type
      Removed value: -"integer"
    • changedOutput schema / properties / data / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "orderId": {
      -        "description": "Newly created order id (`MObjectId`); pass to `tronsave_get_order` to inspect status.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "orderId"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": {},
      +    "properties": {
      +      "orderId": {
      +        "anyOf": [
      +          {
      +            "description": "Newly created order id (`MObjectId`); pass to `tronsave_get_order` to inspect status.",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "Newly created order id (`MObjectId`); pass to `tronsave_get_order` to inspect status."
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedOutput schema / properties / message / anyOf
      Added value: +[
      +  {
      +    "description": "Human-readable status text. Populated even on success; localized error messages may appear here on failure.",
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / message / type
      Removed value: -"string"
    • addedOutput schema / properties / success / anyOf
      Added value: +[
      +  {
      +    "description": "Whether the mutation succeeded at the backend level. Always check this before reading `data`.",
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / success / type
      Removed value: -"boolean"
    • removedOutput schema / required
      Removed value: -[
      -  "code",
      -  "success",
      -  "message"
      -]
  2. Changed4 schema fields changed
    • changedInput schema / properties / paymentMethod / description
      Previous value: -"Payment method for this order: `onchain` (wallet signed tx), `internal` (internal balance), or `pending` (deposit later flow)."New value: +"Payment method for this order: `onchain` (wallet signed tx) or `internal` (internal balance)."
    • changedInput schema / properties / paymentMethod / enum
      Previous value: -[
      -  "onchain",
      -  "internal",
      -  "pending"
      -]New value: +[
      +  "onchain",
      +  "internal"
      +]
    • removedInput schema / properties / paymentPendingRequester
      Removed value: -{
      -  "description": "Optional requester hint for `pending` payment flow when API expects it.",
      -  "type": "string"
      -}
    • changedOutput schema / properties / data / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "depositAddress": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "Pending-payment deposit address — present only when `paymentMethod=pending`; null/absent for `onchain`/`internal`."
      -      },
      -      "depositAmount": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "Pending-payment amount as a decimal string in SUN (BigInt-safe). Pair with `depositAddress` for `pending` flows."
      -      },
      -      "orderId": {
      -        "description": "Newly created order id (`MObjectId`); pass to `tronsave_get_order` to inspect status.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "orderId"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "orderId": {
      +        "description": "Newly created order id (`MObjectId`); pass to `tronsave_get_order` to inspect status.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "orderId"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Changed9 schema fields changed
    • addedInput schema / properties / paymentSignedTx / additionalProperties
      Added value: +{}
    • changedInput schema / properties / paymentSignedTx / description
      Previous value: -"Required when `paymentMethod=onchain`. Serialized signed TRON transaction object (GraphQL JSON). Produced only by wallet/client after user signs."New value: +"Required when `paymentMethod=onchain`. TronWeb-shaped signed TRON transaction (`{ txID, raw_data, raw_data_hex, signature[] }`). Must be produced client-side by the user's wallet; never fabricate or hand-edit."
    • addedInput schema / properties / paymentSignedTx / properties
      Added value: +{
      +  "raw_data": {
      +    "additionalProperties": {},
      +    "description": "Raw transaction body produced by TronWeb (`raw_data`).",
      +    "properties": {
      +      "contract": {
      +        "description": "At least one TRON contract entry; shape varies by contract type.",
      +        "items": {},
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "expiration": {
      +        "description": "Tx expiration (Unix epoch ms).",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "ref_block_bytes": {
      +        "description": "Reference block bytes (hex).",
      +        "type": "string"
      +      },
      +      "ref_block_hash": {
      +        "description": "Reference block hash (hex).",
      +        "type": "string"
      +      },
      +      "timestamp": {
      +        "description": "Tx timestamp (Unix epoch ms).",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "contract",
      +      "ref_block_bytes",
      +      "ref_block_hash",
      +      "expiration",
      +      "timestamp"
      +    ],
      +    "type": "object"
      +  },
      +  "raw_data_hex": {
      +    "description": "Hex-encoded `raw_data` body.",
      +    "pattern": "^[0-9a-fA-F]+$",
      +    "type": "string"
      +  },
      +  "signature": {
      +    "description": "Wallet signatures over `raw_data_hex`; usually a single hex string (130 chars for 65-byte secp256k1).",
      +    "items": {
      +      "minLength": 1,
      +      "pattern": "^[0-9a-fA-F]+$",
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  "txID": {
      +    "description": "Transaction hash (64 hex chars, lowercase, no `0x` prefix).",
      +    "maxLength": 64,
      +    "minLength": 64,
      +    "pattern": "^[0-9a-fA-F]+$",
      +    "type": "string"
      +  },
      +  "visible": {
      +    "description": "Whether addresses inside `raw_data.contract` are base58 (`true`) vs hex (`false`).",
      +    "type": "boolean"
      +  }
      +}
    • addedInput schema / properties / paymentSignedTx / required
      Added value: +[
      +  "txID",
      +  "raw_data",
      +  "raw_data_hex",
      +  "signature"
      +]
    • addedInput schema / properties / paymentSignedTx / type
      Added value: +"object"
    • addedOutput schema / properties / code / description
      Added value: +"GraphQL mutation status code (HTTP-like; `0`/`200` indicates success). Always pair with `success` for routing."
    • changedOutput schema / properties / data / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "depositAddress": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "depositAmount": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "orderId": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "orderId"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "depositAddress": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "Pending-payment deposit address — present only when `paymentMethod=pending`; null/absent for `onchain`/`internal`."
      +      },
      +      "depositAmount": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "Pending-payment amount as a decimal string in SUN (BigInt-safe). Pair with `depositAddress` for `pending` flows."
      +      },
      +      "orderId": {
      +        "description": "Newly created order id (`MObjectId`); pass to `tronsave_get_order` to inspect status.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "orderId"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedOutput schema / properties / message / description
      Added value: +"Human-readable status text. Populated even on success; localized error messages may appear here on failure."
    • addedOutput schema / properties / success / description
      Added value: +"Whether the mutation succeeded at the backend level. Always check this before reading `data`."
  4. Changed1 schema field changed
    • changedInput schema / properties / orderUnitPrice / description
      Previous value: -"Unit price in TRX per TronSave API semantics. Prefer aligning with `minResourcePrice` or `buyResourcePrice` from the latest `tronsave_estimate_buy_resource` for the same receiver, amount, and duration."New value: +"Unit price in SUN. Prefer aligning with `minResourcePrice` or `buyResourcePrice` from the latest `tronsave_estimate_buy_resource` for the same receiver, amount, and duration."
  5. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag readOnlyHint=false, idempotentHint=false and openWorldHint=true, but the description adds substantial context the annotations cannot carry: funds are spent, the auth requirements differ per paymentMethod (api-key header/signature login vs. no login plus a wallet-signed TRX transfer), and the signed tx must be produced client-side, never fabricated. The non-idempotency warning is paired with a concrete recovery procedure — verify before retrying on timeout — rather than just restating the hint.

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?

Front-loaded with the action and the spending warning, and essentially every sentence carries operational value — no filler. It is a dense single block with several clauses chained together, which makes scanning for a specific rule slightly harder than a short bulleted structure would.

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 7-required-parameter mutation with a nested signed-transaction object, the definition covers the auth model, the estimate dependency, the return shape (`{ success, message, code, data.orderId }`) and the retry hazard. Even though an output schema exists, the added return-shape and verification guidance leaves no material gap for correct invocation.

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 coverage is 100%, so the baseline is 3, and the description adds real meaning on top: SUN-not-TRX units, the requirement to take price/amount/duration from the latest estimate, and the conditional relationship between `paymentMethod` and `paymentSignedTx` including which credentials each branch needs. It does repeat some schema text (unit and estimate sourcing) rather than purely extending it, which keeps it just below the top mark.

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 — 'Create a buy order for ENERGY/BANDWIDTH delegated to orderReceiver' — and immediately distinguishes it from the sibling `tronsave_internal_order_create` by naming the internal-balance use case. An agent can tell which order-creation tool applies without opening either 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-to-use routing: API-key integrations paying from internal balance should use `tronsave_internal_order_create`, otherwise this tool. It also mandates a prerequisite ('confirm the plan with the user first'), sources inputs from `tronsave_estimate_buy_resource`, and gives post-call verification tools, leaving nothing to inference.

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