Query a subgraph (paid)
query_subgraphExecute a GraphQL query against a subgraph on The Graph, pay per query in USDC via x402, and receive data with a payment receipt.
Instructions
Run a GraphQL query against a subgraph on The Graph, paying per query in USDC over x402 — gasless and keyless. Returns the data plus a payment receipt (tx hash + amount). Respects the per-query spend cap and returns a fund-wallet message if balance is insufficient.
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": {
"subgraph_id": "<subgraph_id>",
"query": "<query>"
},
"name": "query_subgraph"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subgraph_id | Yes | Subgraph ID (from search_subgraphs) | |
| query | Yes | GraphQL query | |
| variables | No | Optional GraphQL variables |