TORQUEDocs

Ask Torque

Route ad-hoc questions to the Torque AI assistant when no structured tool fits

ask_torque is the escape-hatch tool in the Torque MCP. It proxies a natural-language question to the Torque AI assistant — the same assistant that powers the /api/chat endpoint in the Torque web app — and returns its markdown reply inline.

The /ask-torque prompt is the guided counterpart. It walks the host LLM through checking the session, considering native tools first, clarifying ambiguity, forwarding relevant context, and then calling the tool.

When to Use It

ask_torque is a general catch-all. For common structured tasks, the named MCP tools are faster, cheaper, and more reliable. Reach for ask_torque only when:

  • The question doesn't map cleanly to a structured tool ("why did volume drop last Tuesday?")
  • You need a natural-language → SQL answer for a non-standard data shape
  • You want brainstormed strategy options (not an executed incentive)
  • You need cross-chain or non-Torque on-chain data that only Dune covers
  • You want the assistant to interpret an uploaded file (CSV, markdown, JSON)

Prefer native tools when available

If the user wants…Use this instead
Leaderboards / payout recipients / CSV eval exportsget_epoch_leaderboard
Aggregate epoch stats (participants, distributed, claim rate)get_epoch_aggregate_stats
Standard incentive queries (swap / hold / bonding-curve / custom event / Dune-registered)generate_incentive_query + preview_incentive_query
Creating an incentiveThe create-incentive prompt
Listing projects / offers / events / IDLs / API keysThe respective list tools
Fetching project AI contextget_ai_context

What the Assistant Can Do

The assistant has a tool belt tuned for incentive and data analysis on Solana. When you call ask_torque, it may internally invoke any of:

CapabilityWhat it does
Query the indexed Solana databaseGenerates and runs SQL against Torque's indexed tables (swaps, bonding-curve buys, holds, custom events, IDL instructions, epoch results).
Validate & edit SQLChecks a generated query against the schema and refines it based on feedback.
Analyze data with JavaScriptRuns JS over a prior query result using built-ins (sum, mean, median, percentile, groupBy, countBy, and others).
Suggest incentive strategiesBrainstorms distinct strategy options for a user goal, each with a measure + formula sketch.
Fetch market dataToken prices / market cap / 24h volume for context.
Query Dune (cross-chain, on-chain)searchTables, executeQueryById, getExecutionResults against Dune Analytics — EVM chains and Solana primitives beyond Torque's native coverage. Only available when Dune MCP is configured.
Load project skillsWhen a project admin has uploaded skill files (markdown with frontmatter), the assistant can load them on demand. Inspect project context files via get_ai_context.
Interpret uploaded filesSummarizes / analyzes markdown, text, CSV, JSON, and docx content the user has attached to the session.
Produce download linksGenerates signed URLs for uploaded files and CSV exports.

What the Assistant Does Not Do (in MCP)

  • No chart rendering. The assistant's createChart tool is suppressed. Data appears inline as markdown tables or Unicode sparkline rows.
  • No suggestion chips. The displaySuggestions tool (the follow-up prompt buttons in the web UI) is suppressed.
  • No incentive creation. The assistant will brainstorm and can draft a query, but the actual create flow goes through the create-incentive prompt and create_recurring_incentive tool.

Example Prompts

Data questions (native tools won't help)

  • "Our swap volume dropped 40% on Tuesday vs Monday — what changed? Break down by DEX and hour."
  • "Of the wallets that held more than 1M tokens last week, how many also swapped on Jupiter in the last 30 days?"
  • "Compare incentive claim rates across the last 4 epochs — is the trend up or down?"

Natural-language → SQL

  • "Write me a query that finds wallets who bought on bonding curve then sold on a DEX within 24 hours, with their net P&L in SOL."
  • "How would I express 'median hold time before first sale' for wallets holding our token?"

Strategy recommendations

  • "I want to reward loyal traders without paying bots. Suggest 2 distinct incentive structures."
  • "What's a good way to structure a raffle that rewards activity without giving whales all the tickets?"

Cross-chain via Dune

  • "What's the total Ethereum bridge inflow to Solana in the last 7 days?"
  • "Compare our token's 24h DEX volume to the average of the top-10 memecoins on Base."

File interpretation

  • "(with a CSV attached) Analyze this file and tell me which wallets appear in both columns and their total combined volume."

Conversation Continuity

ask_torque holds message history and a conversationId per MCP session, capped at ~20 messages (oldest user/assistant pairs drop first). The host LLM can call it repeatedly and the assistant will remember prior turns.

Two events reset the conversation:

  • Switching the active project — chat state auto-clears so context doesn't leak across projects.
  • Calling reset_context — clears the chat conversation (and the AI context cache, and the active project) while preserving the auth token. Use this to force a fresh thread without signing out.
  • Full inventory of the assistant's capabilities, including the internal tools it calls: torque://ask-torque/capabilities resource.
  • Tool-level reference (params, return shape, limits): Ask Torque tool.
Ask Torque - Torque Docs