Skip to main content
Glama

Create Order

tronsave_create_order

Create a new buy order on the TronSave market. Key inputs: orderResourceType (ENERGY|BANDWIDTH), orderReceiver (TRON base58), orderUnitPrice in SUN (NOT TRX), orderDurationSec, orderResourceAmount, and paymentMethod: (1) onchain — requires a signed payment tx in paymentSignedTx; (2) internal — deducts from internal balance. Side effect: creates a live order matchable by the market. Requires a signature session and mcp-session-id. Always derive orderUnitPrice and paymentPaymentAmount from the latest tronsave_estimate_buy_resource for the same receiver, amount, and duration to avoid reverts. FRESHNESS: re-quote immediately before submitting — estimates older than a few seconds (one TRON block ≈ 3s) may be stale and cause the order to revert or fill at the wrong price.

Input Schema

TableJSON 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. Prefer aligning with `minResourcePrice` or `buyResourcePrice` from the latest `tronsave_estimate_buy_resource` for the same receiver, amount, and duration.
paymentSignedTxNoRequired 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.
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.
paymentPaymentAmountYesPayment amount in SUN. Prefer deriving from `tronsave_estimate_buy_resource`; if converting to TRX, divide SUN by `1e6`.

Output Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +  }
      +]
  2. 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`."
  3. 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."
  4. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=false, which matches the mutation behavior. The description adds important behavioral context: side effects (creates a live matchable order), required session, and the risk of stale estimates causing reverts or wrong prices. No contradictions with annotations.

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 description is well-structured and front-loaded: it starts with the main purpose, then lists key inputs, explains side effects, and provides usage guidance. While it is somewhat lengthy, each sentence adds value. It could be slightly more concise but is still effective.

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?

Given the complexity (8 parameters, nested objects, multiple payment methods), the description covers preconditions, side effects, and critical constraints. It references the estimate tool for proper parameter derivation. The existence of an output schema reduces the need to explain return values. Overall, it is fairly complete.

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 baseline is 3. The description adds significant value by explaining that orderUnitPrice is in SUN (not TRX), describing payment method semantics, and emphasizing the relationship between parameters and the estimate tool. This goes beyond the schema.

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?

The description clearly states the tool's purpose: 'Create a new buy order on the TronSave market.' It specifies the verb (create), resource (buy order), and key inputs. This distinguishes it from sibling tools like tronsave_cancel_order or tronsave_estimate_buy_resource.

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?

The description provides explicit guidance on when to use each payment method, the need for a signature session and mcp-session-id, and the critical requirement to derive prices from tronsave_estimate_buy_resource. It also warns about freshness. However, it does not explicitly state when not to use the tool.

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