Skip to content

getToolDefinitions omits transfer_nft.fromAddress, so native tool-calling cannot express it #112

Closed

Description

@Yash-arch-ui

What happened

ACTIONS.transfer_nft documents fromAddress as an optional argument, and both model-facing prompts render it as fromAddress? — but the tool schema the default protocol actually sends to the model does not contain it at all.

ACTIONS.transfer_nft = {
  args: ["to", "contractAddress", "tokenId"],
  optionalArgs: ["fromAddress"],        // src/tools.mjs:48
  …
}

nativeSystemPrompt()
  → "- transfer_nft(to, contractAddress, tokenId, fromAddress?): Send an ERC-721 NFT …"

getToolDefinitions().find(t => t.name === "transfer_nft").parameters
  → properties: { to, contractAddress, tokenId }     // no fromAddress
  → required:   [ "to", "contractAddress", "tokenId" ]

Expected

fromAddress declared as an optional string property (and left out of required), so a native-mode model can actually use the approval-transfer path the prompt tells it about.

Why it matters

USE_NATIVE_TOOLS defaults to true (src/config.mjs:146), so this schema is what ships. In native mode the system prompt promises a parameter the schema drops:

  • a model that follows the prose and passes fromAddress is sending an undeclared argument;
  • a model that reads the schema never learns the path exists at all — "Sends from the agent's own wallet unless fromAddress is given" is the only description of it.

The v0 fallback path (systemPrompt() → src/tools.mjs:126, which maps optionalArgs to ?) is already correct, so the two advertised surfaces disagree.

Repro

node --input-type=module -e '
const t = await import("./src/tools.mjs");
console.log(t.nativeSystemPrompt().split("\n").find(l => l.includes("transfer_nft")));
console.log(Object.keys(t.getToolDefinitions().find(d => d.name === "transfer_nft").parameters.properties));
'
- transfer_nft(to, contractAddress, tokenId, fromAddress?): Send an ERC-721 NFT …
[ 'to', 'contractAddress', 'tokenId' ]

Notes

#69 covered fromAddress validation plus its absence from ACTIONS.args, and closed before native tool-calling merged (367ef72, 2026-09-11) — so the native tool schema was never covered by that fix. This issue is about the schema only; the validation work from #69 is already in runAction.

Scope

Add the optional fromAddress property to the transfer_nft entry in getToolDefinitions() (src/tools.mjs:1285), keeping it out of required, so it matches ACTIONS and the prompt.

Environment

  • branch: main @ a20f533
  • OS: Linux x64, node v24.10.0
  • Gas mode: n/a (pure schema/prompt inspection)

Activity

  1. Yash-arch-ui commented on Sep 28, 2026

    @Yash-arch-ui
    CollaboratorAuthor

    Ill take this !!!

  2. Yash-arch-ui commented on Sep 28, 2026

    @Yash-arch-ui
    CollaboratorAuthor
  3. portdeveloper commented on Sep 28, 2026

    @portdeveloper
    Owner

    @Yash-arch-ui the claim is registered and the issue is assigned to you. One claim at a time pool-wide; a claim with no pull request or progress update after 7 days is released (agents.md, https://most.devnads.com). Good luck!

  4. Yash-arch-ui commented on Sep 29, 2026

    @Yash-arch-ui
    CollaboratorAuthor

    PR opened: #113 — adds fromAddress as an optional string property on the transfer_nft schema (out of required), plus a test pinning it and a generic ACTIONS-vs-schema drift check for all 9 tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions