query_for_goal
Maps a natural-language goal to a bounded GraphQL query against registry entities, returning rationale, confidence, alternatives, or null when no confident match exists.
Instructions
Turn a goal into a bounded, goal-specific GraphQL query: maps intent (pool ids, swaps, candles/OHLCV, daily/hourly data, positions, liquidations, tokens, addresses, time ranges, latest/top) to a deployment entity from the registry's crawled entity names, with rationale, confidence, unmet parts and ranked alternatives. Returns query:null instead of a misleading query when no entity maps confidently; goals without entity intent get the stored starter labelled generic. Keyless default makes NO network call. validate_schema=true (your own Studio key) adds ONE scoped introspection request per deployment to confirm fields/arguments, typed ordering/filters and serving freshness; execute=true adds ONE gateway POST. If the chosen deployment times out, has failing indexers or is stale, it is skipped (reported in goal_mapping.skipped_deployments) and the next deployment that fits the goal is tried: at most 3 deployments and 6 gateway requests, never x402. Reward/curation status is not treated as unhealthy. Token/pool results are checked for likely spam (URL/lure names, implausible TVL, TVL without volume, low activity): flagged rows are reported in token_quality and, by default, moved after the others; nothing is removed. Without a key, onboarding explains the human-operator key setup.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"goal": "<goal>"
},
"name": "query_for_goal"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | Yes | ||
| chain | No | ||
| first | No | Rows to request; defaults to a number in the goal (e.g. top 3) or 5 | |
| execute | No | Explicit opt-in to spend a Studio gateway query; never auto-pays x402 | |
| spam_handling | No | Token/pool rows: flag likely spam and move flagged rows last (default), only flag, or disable. Rows are never removed. | flag_and_push_down |
| include_denied | No | Also consider deployments with denied indexing rewards (not proof of unavailability) for entity matching | |
| trusted_tokens | No | Extra known-good token addresses never flagged as spam (adds to a small built-in per-chain allowlist) | |
| validate_schema | No | Opt-in: with your own Studio key, one scoped live introspection request validates the generated fields/arguments before any execution | |
| include_unserved | No | Also consider deployments with zero active allocations in the snapshot (not a queryability test) |