Skip to Content
Welcome to RitoSwap's documentation!

key_nft_read

dapp/app/lib/mcp/tools/keynft-read/index.ts consolidates the historical reader tools into one RPC surface. The action field selects which helper under actions/* executes.

Supported Actions

ActionPurposeHandler
get_key_nft_collection_infoStatic contract metadataactions/collection-info.ts
get_key_nft_total_supplyTotal minted keysactions/total-supply.ts
get_key_nft_balanceCount of keys owned by an addressactions/balance.ts
get_key_nft_tokens_of_ownerFull list of token IDs for an owneractions/owner-tokens.ts
get_key_nft_token_of_ownerSingle token lookup with boolean hasTokenactions/owner-single.ts
get_key_nft_token_metadataColors + URI for a token IDactions/token-metadata.ts
get_key_nft_holdersAggregate view of holdersactions/holders.ts
get_key_nft_summary_for_ownerCombined balance + palette summaryactions/owner-summary.ts

Handler Skeleton

// dapp/app/lib/mcp/tools/keynft-read/index.ts const tool: Tool<Params> = { name: 'key_nft_read', description: 'Consolidated Key NFT read functions...', inputSchema: InputSchema, async handler(input: Params) { switch (input.action) { case 'get_key_nft_collection_info': return handleCollectionInfo(); case 'get_key_nft_total_supply': return handleTotalSupply(); case 'get_key_nft_balance': return handleBalance(input); case 'get_key_nft_tokens_of_owner': return handleOwnerTokens(input); case 'get_key_nft_token_of_owner': return handleOwnerSingle(input); case 'get_key_nft_token_metadata': return handleTokenMetadata(input); case 'get_key_nft_holders': return handleHolders(input); case 'get_key_nft_summary_for_owner': return handleOwnerSummary(input); default: fail('Unknown action for key_nft_read'); } }, };

Each action pushes both text and JSON shapes so screens and LLM prompts can stay synchronized (e.g., the metadata action returns token colors, while the owner-summary includes palette plus count).

Presenter Coverage

dapp/components/chatBot/ToolActivity/catalog/presenters/keynft_read.presenter.ts is one of the largest presenters because it mirrors the action list. Highlights:

  • Pending copy switches on action (e.g., Listing Owner Tokens…, Fetching Token Metadata…).
  • Success copy formats counts, token IDs, palettes, and network names (using public.env.ts to label RitoNet).
  • Error copy detects wallet/auth failures and prompts the user to reconnect when necessary.

Tips

Since key_nft_read is read-only, it does not require JWTs. However, owners looking up their own tokens often call it right before manage_key_nft or mark_key_used, so the presenter deliberately mirrors wallet-focused phrasing to reinforce that flow.

RitoSwap Docs does not store, collect or access any of your conversations. All saved prompts are stored locally in your browser only.