Skip to Content
Welcome to RitoSwap's documentation!
AI SystemsMCP Stackkeynft_used_count

keynft_used_count

Simple but essential, this tool lives in dapp/app/lib/mcp/tools/keynft-used-count.ts. It queries Prisma to find how many Key NFTs have used=true for the current network.

Implementation

// dapp/app/lib/mcp/tools/keynft-used-count.ts const tool: Tool<Params> = { name: 'keynft_used_count', description: 'Return only the total number of key NFTs marked as used=true for the active chain.', async handler() { const Token = getTokenModel(prisma); const total = await Token.count({ where: { used: true } }); const text = textResult(String(total)); const json = jsonResult({ total }); return { content: [...text.content, ...json.content] }; }, };

It does not accept any parameters and only returns a text number + JSON { total }, making it safe for dashboards or daily quotas.

Presenter

dapp/components/chatBot/ToolActivity/catalog/presenters/keynft_used_count.presenter.ts adds the network name (derived from publicConfig.activeChain):

  • Pending — Counting Used Keys.
  • Success — Used Keys Total (Sepolia) with the numeric value.
  • Error — Failed to Count Used Keys plus the raw error message.

Notes

Because this tool is read-only, it does not require JWTs. It still benefits from the state service’s Prisma routing, so the number always reflects whichever chain the dapp is configured to target.

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