Skip to main content
Glama

Bitquery: Crypto & Blockchain Data

Ltc Transfers Raw Sql

ltc_transfers_raw_sql
Read-only

LAST RESORT — arbitrary READ-ONLY SQL against the Litecoin transfers data. The ltc_* tools are the PRIORITY; use this ONLY when none of them can answer. No query optimizer here: filter on the per-key tables and NEVER JOIN big tables (use IN (SELECT …), the only way to "follow" across txs). Runs read-only ClickHouse SQL. SQL reference: https://clickhouse.com/docs/reference/home This data runs on an older release of the engine: some functions and syntax in that reference (map() and toJSONString() among them) do not exist here — when a statement is refused for an unknown function or setting, use the forms shown in this description. Every table has a blockchain_id column and also holds rows of other blockchain_id values: filter blockchain_id = 6 (Litecoin) on EVERY table you read, inside each IN (SELECT …) as well — block numbers are not unique across blockchain_id values, so an unfiltered read mixes in rows that are not Litecoin's. Query the plain names of db altcoin, NEVER a _storage table (each holds only part of the data). Tables (db altcoin): altcoin.inputs_by_address / outputs_by_address (by address), altcoin.inputs_by_tx (by tx; cols address, tx_id_bin, value, output_tx_id_bin, output_index) and altcoin.outputs_by_tx (by tx; cols address, tx_id_bin, output_index, value and direction, an Enum unknown/not_change/change/likely_not_change/likely_change/mining/fee/minting/genesis), altcoin.transactions (one row per tx: tx_date, input_value, output_value, fee_value, is_coinbase; look a hash's tx_date up here first). Every altcoin table is partitioned by month on tx_date — add a tx_date bound whenever you can: a read by address or tx alone probes every month since the chain began. Db altcoin_flow: address_transfers (keyed by blockchain_id, address; AggregateFunction → -Merge; its count / sum totals hold a few duplicated and missing records — take exact totals from the altcoin tables), outputs_to_address (by address), tx_inputs / tx_outputs (by block, tx_index; a few whole blocks are missing). Addresses & tx ids: address is a plain string (L… / M… base58, ltc1… bech32 lowercase; m-… / d-… placeholders for bare multisig / non-standard scripts; empty for coinbase inputs and fee rows); tx_id_bin = unhex('<64hex>'), output hex(tx_id_bin); value is Decimal(18,8), already in LTC (a JSON number: above about 1e8 it loses its last decimals - return toString(value) when every decimal matters). Date-times come back as 'YYYY-MM-DD hh:mm:ss' UTC; select formatDateTime(tx_time, '%FT%TZ') for ISO-8601 (2026-09-21T15:04:18Z), the shape the other tools return. Address labels: none in this data — use labels_for_addresses(chain='litecoin'). Read-only; JSONEachRow. A result of more than 25,000 rows is not cut off - the whole query fails with an error - so aggregate (GROUP BY, count) or add a LIMIT of at most 25,000. 64-bit integers come back as JSON numbers, exact only up to 2^53: return a hash such as cityHash64(...) or any other 64-bit id as toString(x).

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": {
      "sql": "<sql>"
    },
    "name": "ltc_transfers_raw_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesA single read-only SELECT on the altcoin / altcoin_flow tables, with blockchain_id = 6 on every table read. Use indexed (*_by_address / *_by_tx) filters; no JOINs over big tables.
formatNoShape of the returned data. "rows" (the default) returns one item per row. "columnar" returns a single item, {"columns":[...],"rows":[[value,...],...]}, naming the columns once and listing each row's values in that order; it is more compact for large results and carries the same values.rows

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / format
      Added value: +{
      +  "default": "rows",
      +  "description": "Shape of the returned data. \"rows\" (the default) returns one item per row. \"columnar\" returns a single item, {\"columns\":[...],\"rows\":[[value,...],...]}, naming the columns once and listing each row's values in that order; it is more compact for large results and carries the same values.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description goes far beyond: it explains that a result over 25,000 rows causes the entire query to fail, that 64-bit integers are only exact to 2^53, that date-times need formatDateTime for ISO-8601, and that `altcoin_flow` totals have duplicated/missing records. These are critical behavioral traits not captured by annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but front-loaded: the first sentence establishes LAST RESORT and the read-only SQL scope. Every subsequent sentence adds a concrete constraint, table detail, or failure mode that is necessary for correctly invoking an arbitrary-SQL tool. Removing any sentence would likely cause an incorrect or failed query.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, but the description covers the return shape: JSONEachRow, the optional columnar format, ISO-8601 datetime output, and toString recommendations for exact decimals and 64-bit values. It also documents table schemas, query constraints, and data quality caveats. An agent has everything needed to issue a correct query and understand its results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the two parameters are already documented. However, the description adds extensive semantics for the `sql` parameter beyond the schema: it lists the exact tables and columns, warns against `_storage` tables, requires `blockchain_id = 6` on every read, notes unsupported functions (`map()`, `toJSONString()`), and explains partitioning. This substantially reduces the chance of malformed queries.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'arbitrary READ-ONLY SQL against the Litecoin transfers data,' and immediately distinguishes itself from the ltc_* family ('the PRIORITY; use this ONLY when none of them can answer'). An agent can tell exactly what this tool does and why it exists alongside the many ltc_* siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use it (only when no ltc_* tool can answer) and names the alternative family. It also gives operational guidance: 'filter on the per-key tables and NEVER JOIN big tables (use IN (SELECT …)).' Nothing is left to inference about routing or query shape.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.