Learn Using DeepSeek for structured tool calls

SUIBROKERS DAO · field note

Using DeepSeek for structured tool calls

A bounded workflow for schemas, read-only tool results, validation errors, and user-controlled wallet actions.

OPEN THE APP ALL NOTES
Two pixel-art builders trace a schema card through a brass tool cabinet while a malformed input is rejected before a closed wallet envelope.

DeepSeek’s tool-calling workflow is easiest to understand as a structured conversation: the model requests a function, the application runs it, and the result returns to the model. That pattern can support read-only crypto research when the schema and approval boundary are explicit.

Begin with a small schema

Define a tool with a name, purpose, and JSON Schema for its arguments. For a public status read, the input can be an empty object. For a wallet history read, require a canonical wallet and bound the list limit. A schema is part of the safety lesson because it tells the host what the tool accepts and what it refuses.

DeepSeek’s Tool Calls guide shows the round trip: the model returns a function call, the user’s application invokes the function, and a tool result is sent back. The guide also states that the model itself does not execute the function. A valid tool call is therefore an instruction to the application, not a wallet authorization.

Here is a deliberately illustrative, read-only round trip. It is a teaching fixture, not executable trading code. The schema requires one Sui address and limits the requested rows to a small range; the request and result use those same names and constraints:

{
  "function": {
    "name": "read_swap_history",
    "description": "Read confirmed swap records for one wallet",
    "parameters": {
      "type": "object",
      "properties": {
        "wallet": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" },
        "limit": { "type": "integer", "minimum": 1, "maximum": 20 }
      },
      "required": ["wallet", "limit"],
      "additionalProperties": false
    }
  },
  "request": {
    "name": "read_swap_history",
    "arguments": { "wallet": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "limit": 5 }
  },
  "result": {
    "wallet": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "rows": [],
    "status": "zero",
    "source": "read-only service response",
    "asOf": "2026-10-06T12:00:00Z"
  }
}

The example intentionally returns zero, which means no rows were reported for that bounded read. It does not mean the wallet is inactive everywhere, and it does not authorize a transaction. A real host would validate the address and limit before making its own read request, then preserve the service’s returned status and timestamp.

Use the participant kit as a concrete example

The SUI BROKERS participant kit publishes six tools. Five perform bounded GET reads for status, season, swap history, Desk, and partner activity. The sixth, suibrokers_prepare_action, returns a review-only plan for a possible swap, Desk action, partner task, or points review. It validates wallet and coin-type inputs, maps the action to an app route, and keeps prefill false.

The kit does not quote, build, sign, send, boot a wallet, activate a referral, or mint an NFT. A builder can use DeepSeek to decide when to request a read or explain the returned JSON, but the host still owns the HTTP request and the reader still owns the wallet decision. Confirm whether the chosen DeepSeek host can connect to MCP or the tool interface you intend to use; the model name alone does not establish that integration.

Compare malformed and valid calls

Start with a malformed wallet such as a string that does not match a Sui address. The host should show a validation error before an upstream request. Try a malformed coin type next. Then make a valid read-only call with a bounded limit and inspect the returned origin, endpoint, and asOf timestamp.

Ask the model to summarize the result with these rules:

  • preserve pending, confirmed, partial, zero, and unavailable as returned;
  • leave missing fields unknown;
  • quote the source endpoint beside each conclusion;
  • never convert a plan into a transaction;
  • ask for the wallet before a wallet-scoped read.

This format catches the common failure where a model turns “no rows returned” into “the service is healthy” or “unavailable” into zero activity.

Keep the financial boundary visible

If the workflow reaches a swap, the app and wallet remain the sources for current assets, amounts, route, gas, and signature. The current rule credits one Point per $4 of verified Swap volume only after the service confirms and verifies the record. A tool call, installation, simulation, or unconfirmed transaction does not create Points.

DeepSeek can make a typed tool workflow easier to inspect. The result is trustworthy only when the schema, host, source, returned status, and human approval boundary remain visible. If the next step would affect a wallet, stop at the structured result and let the app and wallet handle review and signing explicitly.

Make your
next move.

Open the app to swap on Sui, explore The Desk, and track your Points.

OPEN APP Connect your Sui mainnet wallet when you are ready to act.