Eia Energy Mcp Server

io.github.cyanheads由 GitHub 账号 cyanheads 发布v0.5.1更新于 Nov 4, 2026

Browse and query the EIA API v2 — electricity, petroleum, natural gas, coal, forecasts via MCP.

已验证Streamable HTTP可网页运行数据库网页搜索与抓取数据与分析

概览

AI 生成的概览

浏览、搜索并查询美国 EIA 能源数据(电力、石油、天然气、煤炭、预测),并可对暂存结果运行 SQL。

可以做什么
  • 浏览与搜索 EIA 数据集分类树,支持按路由名称、序列名称和分面值模糊搜索,并可将旧版 APIv1 序列 ID 解析为路由
  • 查看叶子路由的分面、有效取值、数据列、单位、频率和日期范围
  • 按分面过滤、日期范围、频率、列选择、排序和分页获取时间序列数据
  • 将查询结果暂存为 DataCanvas 表,列出其结构与来源,并对其运行只读 SQL SELECT
  • 可选地删除已暂存的数据帧以释放内存
适用场景
适合需要权威美国能源统计数据(价格、发电、装机容量、消费或预测)进行分析、报告,或对大体量结果做 SQL 式聚合的场景。
运行要求
需要一个免费的 EIA API 密钥,通过环境变量 EIA_API_KEY 提供(DEMO_KEY 很快会触发限流)。可作为公开托管的 Streamable HTTP 端点使用,也可通过 npx/bunx(需 Bun 1.4+ 或 Node.js 24+)或 Docker 在本地运行。需要访问 EIA API 的网络。DataCanvas SQL 工具默认开启,可用 CANVAS_PROVIDER_TYPE=none 关闭。
安装前请注意
EIA_API_KEY 会作为 api_key 查询参数随每次请求发送,请避免写入共享配置或日志。查询对 EIA 数据是只读的,但暂存会把数据行写入按租户共享的画布,可能与其他暂存表关联,且暂存数据会保留到过期或被删除。公开托管实例由第三方运营;若密钥必须留在本地,请自行部署。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Eia Energy Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.cyanheads%2Feia-energy-mcp-server/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "eia-energy": {
      "type": "http",
      "url": "https://eia-energy.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/eia-energy-mcp-server

Browse and query the U.S. Energy Information Administration API v2 — electricity, petroleum, natural gas, coal, forecasts, and more via MCP. STDIO or Streamable HTTP.

4 core tools + 3 DataCanvas tools


Overview

US energy data from the Energy Information Administration (EIA): electricity, petroleum, natural gas, coal, and forecasts. Find datasets in plain language, query time series with facet filters, and run SQL over large results.

Tools

ToolDescription
eia_browse_routesLists child routes under a path in the EIA dataset taxonomy; omit path for the 14 top-level categories.
eia_describe_routeReturns a leaf route's facets, valid values, data columns, frequencies, and date range.
eia_search_routesFuzzy text search across route names, descriptions, data-column names, STEO, SEDS, and Monthly Energy Review series names, and facet values — including benchmark series such as Henry Hub, WTI, and Cushing. Resolves legacy APIv1 series IDs (PET.RWTC.W) to their route and filters.
eia_query_routeFetches data from a leaf route with facet filters, date range, and column selection; optionally stages results for SQL.
eia_dataframe_describeLists active DataCanvas dataframes staged by eia_query_route, with schema and provenance.
eia_dataframe_queryRuns a read-only SQL SELECT against staged DataCanvas dataframes.
eia_dataframe_dropDrops a DataCanvas dataframe, freeing its memory.

The three eia_dataframe_* tools need DataCanvas, which is on by default; eia_dataframe_drop additionally requires EIA_DATAFRAME_DROP_ENABLED=true. With CANVAS_PROVIDER_TYPE=none, which the Claude Desktop bundle sets, they are neither callable nor listed by MCP. Disabled definitions remain in the server manifest with their enable hints. A default deployment lists the first six tools.

Capability reference

Browse accepts route as an alias for path; describe and query accept path as an alias for route. Supplying both spellings is rejected. Whitespace and slashes are normalized, then exactly one complete leading v2 segment is removed: /v2/electricity/retail-sales/ resolves to electricity/retail-sales, and /v2/ browses root. Full URLs, /data suffixes, interior v2, and case remain unchanged.

All four route tools distinguish retryable upstream failures: rate_limited for HTTP 429 or OVER_RATE_LIMIT, upstream_unreachable for transport failures, upstream_unavailable for HTTP service outages, upstream_invalid_response for unusable bodies or missing envelopes, and upstream_timeout when EIA does not answer in time — each attempt is cut at 45 s, and a call's attempts, backoffs, and chained requests share one 56 s deadline, inside the 60 s timeout MCP clients apply. Recovery hints reach both response surfaces. HTTP 501 remains definitive, 504 remains a timeout, and caller cancellation stays cancellation.

eia_browse_routes tool

  • Omit path for the 14 top-level categories; pass a path to browse its children.
  • Each child carries isLeaf: describe and query leaves, or browse categories further.
  • A missing path returns route_not_found; EIA rate-limiting, being unreachable, or not answering in time returns retryable rate_limited, upstream_unreachable, or upstream_timeout.

eia_describe_route tool

  • Pass a leaf route for facets, data columns, frequencies, and date range. Each facet window is capped at EIA_FACET_VALUE_CAP (default 50); page with facet and values_offset.
  • To find a value by name in a large facet (plant, entity, and mine IDs run to thousands), pass values_query: each facet keeps the values whose id, name, or alias contains it, ignoring case, and values_offset pages the matches. values_query: "palo verde" on electricity/facility-fuel's plantCode returns 6008 and 57773 in one call. On the balancing-authority facets of electricity routes (respondent, fromba, toba, parent, balancing_authority_code), a value also matches by its ISO/RTO acronym: ERCOT returns ERCO, SPP returns SWPP and SWPW, and CAISO on stateid matches nothing.
  • date_range is metadata for the default frequency; another frequency may extend outside it. Both response surfaces carry this caveat beside the unchanged start/end values.
  • value_count, values_truncated, and, with values_query, values_matched describe each window. A facet whose values EIA did not return is listed in unavailable_facets; the next call retries it.
  • A data column with units: "" has no unit in the route metadata. The notice names the eia_query_route row field its unit is in when a row has one ({col}-units, or units or unit on routes whose only column is value), since the unit can differ by row; a column whose rows have no such field, like county or latitude on electricity/operating-generator-capacity, has no unit. The notice also names facet lists EIA publishes partial: international's productId, activityId, and unit cover only its monthly and quarterly series.
  • Errors: route_not_found, route_not_queryable, facet_not_found, and retryable facet_unavailable, rate_limited, upstream_unreachable, upstream_timeout.

eia_search_routes tool

  • Search route names, descriptions, the data columns a route publishes (nameplate capacity → electricity/operating-generator-capacity), STEO's 1,469, SEDS's 968, and the Monthly Energy Review's 984 series names (primary energy consumption total or its ID TETCBUS → total-energy, msn: TETCBUS), and facet values. Before any describe, the facet values cover fuel, sector, technology, and coal-rank vocabularies, RTO balancing authorities by name, EIA code, or ISO/RTO acronym (Electric Reliability Council of Texas, ERCO, or ERCOT → respondent: ERCO), and the series and product names of the daily and weekly petroleum and natural-gas routes (Henry Hub → natural-gas/pri/fut, series: RNGWHHD); describing a route adds its own. limit defaults to 10; a larger value returns at most 30 and says so, even on short or empty results. truncated is true when more matches exist. Only the first 256 characters of query are searched, with a notice when it is cut.
  • Matches carry score (0 exact, 1 no match; above 0.72 is weak) and may carry a filter_hint for eia_query_route. Check indexComplete and indexGaps before trusting a short result set.
  • A legacy APIv1 series ID, as EIA's website and Excel add-in write them, is resolved through EIA's /v2/seriesid lookup before any text search, in any case: ELEC.PRICE.TX-RES.M returns one result, electricity/retail-sales with filter_hint {sectorid: "RES", stateid: "TX"}, frequency: "monthly", and columns: ["price"], ready for eia_query_route. A hit needs no index, so it answers in under a second even on a cold server. When EIA's own lookup reports no rows for the mapping it returns (some AEO IDs), the notice says the query will come back empty. An ID EIA does not recognize (PET.ZZZZZZ.W, or U.S.A, which only looks like one) returns the text search with a notice saying so; a lookup that times out, is rate-limited, or hits an outage does the same with a retry notice, never an error.
  • The first search builds the index and normally takes 20–40 s (at most 45 s); later searches answer from the built index. If EIA rate-limits, cannot be reached, or does not answer in time, the call fails with retryable rate_limited, upstream_unreachable, or upstream_timeout.

eia_query_route tool

  • Pass a leaf route, with optional facet-ID filters, columns, frequency, start/end, and sort. Page with offset and length (default 25; a larger value returns at most 5,000 and says so).
  • Returns length rows per page; continue at next_offset (= offset + returned count).
  • After describe has cached a complete facet vocabulary, and for 24 hours after that list was fetched, query notices name unmatched filter values and suggest case-sensitive IDs when possible. A value a returned row carries is never named, and lists EIA publishes partial are never used. Filters and their echoes stay unchanged; diagnostics never fetch metadata or facet values.
  • With effective monthly YYYY-MM data, a year-only bound means January: end: "2021" stops at 2021-01; use 2021-12 for the full year. Query notices disclose this for either bound without expanding it.
  • EIA reads each bound as the period of the effective frequency containing its first day, so start: "2023-01", end: "2023" returns January at monthly. A range is reported as inverted (no_data) only when EIA returns no rows and start selects a later period than end; the message names both periods. At local-hourly each bound needs its hour and UTC offset (2024-02-01T02-06); one without fails as invalid_period before any request. So does a bound EIA would not read as written: a month outside 01–12 or an hour that is not two digits at any frequency, and a day its month lacks or an hour past 23 that rolls into another period at the effective frequency — 2024-02-30 at daily or monthly, 2024-01-31T24 at monthly. At weekly and four-week-average only the day is checked; an hour past 23 is sent, since whether it rolls into another week depends on the route's weekly calendar. A rollover that stays inside the period it names is sent, since EIA answers with that period (2024-02-30 at quarterly is 2024-Q1).
  • total reports the full match count; values remain strings and units appear per row as {col}-units, or as units or unit on routes whose only column is value; a route that puts no unit on its rows states it in describe's data_columns[].units. Errors cover invalid route, facet, column, frequency, sort, or period, inverted ranges (no_data), a filter list too long for EIA's ~8 KB request URI (uri_too_long; split the values across calls), and retryable rate_limited, upstream_unreachable, and upstream_timeout.
  • stage: true stages up to EIA_CANVAS_MAX_ROWS (default 25000) as a dataset handle for SQL via eia_dataframe_describe and eia_dataframe_query (hyphens in column names become underscores). If staging fails, dataset is absent and the note says so. Staging that would run past the call deadline stops before the next page, stages the rows already fetched, and the note says time ran out and gives the offset to resume from.

eia_dataframe_describe tool

  • Omit name to list active staged dataframes; pass a handle to inspect one. A miss returns found: false with active_names.
  • Entries carry source_tool, query_params, created_at, expires_at, row_count, truncated/max_rows, and column_schema. Listing does not extend expiry.

eia_dataframe_query tool

  • Run one read-only SQL SELECT against staged handles. Inline rows follow preview (default 25; a larger value returns at most row_limit and says so, and 0 returns none). row_limit defaults to 1,000 and returns at most 10,000. Echoes (executedSql, columns) come back whole. register_as still stages the complete result.
  • truncated: true means totalRows is a cap, not a full count. register_as stages the complete result under an unused name with an exact count; the notice gives the LIMIT/OFFSET query, with no ORDER BY, that pages the rest in the order the preview showed. A result with no rows still lists its columns.
  • Cast EIA VARCHAR values for arithmetic. Writes, file reads, and system catalogs are rejected; declared failures include missing_table, invalid_sql, non_select_statement, denied_function, multi_statement, sql_read_only, system_catalog_access, and register_as_clash.

eia_dataframe_drop tool

  • Pass name to remove a staged dataframe; requires EIA_DATAFRAME_DROP_ENABLED=true.
  • Returns dropped: false when nothing matched; a failed drop returns retryable canvas_drop_failed and the dataframe stays staged. Cleanup is optional: dataframes expire after 24 h unused.

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

EIA-specific:

  • Covers all 14 top-level dataset categories of EIA API v2, with the route tree cached in process
  • Fuzzy search (Fuse.js) over route names/descriptions, data-column names, all 1,469 STEO, 968 SEDS, and 984 Monthly Energy Review series names, and facet values — 1,753 benchmark petroleum and natural-gas series names and the RTO balancing authorities (by name, code, or ISO/RTO acronym) among them, indexed at warm time
  • Facet values are fetched and cached per route by eia_describe_route for 24 hours, after which the next describe re-fetches the route; a list EIA does not return is reported in unavailable_facets and retried on the next call, and a refresh EIA does not answer serves the cached values with a notice naming when they were fetched
  • Routes whose metadata could not be fetched are reported through eia_search_routes instead of dropped
  • DataCanvas (DuckDB) is on by default and staging is opt-in per call; with the canvas off the three dataframe tools are not callable
  • Count inputs (length, row_limit, preview, limit) lower an over-cap value to its cap with a notice; EIA_CLAMP_LIMITS=false advertises and enforces each cap as a schema maximum instead

Agent skill:

  • eia-energy-guide carries the gates for answering energy questions with these tools: per-route geography codes, total rows beside their components, per-row unit columns, nulls and zeros, and forecasts mixed with history. MCP clients read it from the server as skill://eia-energy-guide/SKILL.md; it also ships in the npm package, the Docker image, and the .mcpb bundle, and plugin installs scan it from skills/.

Agent-friendly output:

  • Provenance — eia_query_route echoes the canonical route, and staged dataframes record their source_tool and query_params
  • Capped-window disclosure — truncated responses report the count against the cap and a notice naming the next call
  • Typed failures — error reason values (e.g. route_not_queryable, invalid_facet, missing_table) carry a recovery hint

Getting started

Public Hosted Instance

A public instance is available at https://eia-energy.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:

json
{  "mcpServers": {    "eia-energy-mcp-server": {      "type": "streamable-http",      "url": "https://eia-energy.caseyjhand.com/mcp"    }  }}

Self-Hosted / Local

Get a free API key at api.eia.gov, then add the following to your MCP client configuration file.

json
{  "mcpServers": {    "eia-energy-mcp-server": {      "type": "stdio",      "command": "bunx",      "args": ["@cyanheads/eia-energy-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info",        "EIA_API_KEY": "your-api-key"      }    }  }}

Or with npx (no Bun required):

json
{  "mcpServers": {    "eia-energy-mcp-server": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@cyanheads/eia-energy-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info",        "EIA_API_KEY": "your-api-key"      }    }  }}

Or with Docker:

json
{  "mcpServers": {    "eia-energy-mcp-server": {      "type": "stdio",      "command": "docker",      "args": [        "run", "-i", "--rm",        "-e", "MCP_TRANSPORT_TYPE=stdio",        "-e", "EIA_API_KEY=your-api-key",        "ghcr.io/cyanheads/eia-energy-mcp-server:latest"      ]    }  }}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 EIA_API_KEY=your-key bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.4.0 or higher (or Node.js v24+).
  • A free EIA API key from api.eia.gov. The DEMO_KEY hits rate limits quickly; a real key is required for sustained use.

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/eia-energy-mcp-server.git
  1. Navigate into the directory:
sh
cd eia-energy-mcp-server
  1. Install dependencies:
sh
bun install
  1. Configure environment:
sh
cp .env.example .env# edit .env and set required vars (at minimum, EIA_API_KEY)

Configuration

All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:

VariableDescriptionDefault
EIA_API_KEYRequired. Free API key from api.eia.gov — appended as api_key on every request.—
EIA_BASE_URLEIA API base URL.https://api.eia.gov/v2
EIA_DATASET_TTL_SECONDSDataframe lifetime in seconds, at most 31,536,000 (365 days); each eia_dataframe_query that references a dataframe extends it.86400 (24 h)
EIA_DATAFRAME_DROP_ENABLEDSet to true to expose eia_dataframe_drop (no effect with CANVAS_PROVIDER_TYPE=none). Off by default to avoid accidental canvas cleanup.false
EIA_CANVAS_MAX_ROWSRow ceiling for eia_query_route staging, at most 250,000. Reaching it costs five more requests: about 8.5 s on narrow routes such as electricity/retail-sales, 30–46 s on wide ones such as electricity/facility-fuel. Staging that would run past the call deadline stops early and names the offset to resume from.25000
EIA_FACET_VALUE_CAPFacet values eia_describe_route returns per facet before truncating, at most 1,000; page with facet and values_offset, or narrow with values_query.50
EIA_CLAMP_LIMITSLower an over-cap length, row_limit, preview, or limit to its cap with a notice; false advertises and enforces each cap as a schema maximum instead.true
CANVAS_PROVIDER_TYPEDataCanvas provider. duckdb enables eia_dataframe_describe, eia_dataframe_query, and stage: true; drop also needs EIA_DATAFRAME_DROP_ENABLED=true. none disables DataCanvas. The Claude Desktop bundle sets none.duckdb
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTHTTP server port.3010
MCP_HTTP_ENDPOINT_PATHHTTP endpoint path./mcp
MCP_SESSION_MODEHTTP sessions: stateless, stateful, or auto.stateless
MCP_PUBLIC_URLPublic origin override for TLS-terminating reverse-proxy deployments.—
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
STORAGE_PROVIDER_TYPEStorage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1.in-memory
OTEL_ENABLEDEnable OpenTelemetry instrumentation.false

See .env.example for the full list of optional overrides.

Running the server

Local development

  • Build and run:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, securitybun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions against spec

Docker

sh
docker build -t eia-energy-mcp-server .docker run --rm -e EIA_API_KEY=your-key -p 3010:3010 eia-energy-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/eia-energy-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools and inits services.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts) — browse, describe, search, query, and three DataCanvas dataframe tools — plus the shared count-input cap (count-limit.ts).
skills/Published agent skill (eia-energy-guide), served over MCP and shipped in the npm package, Docker image, and .mcpb bundle.
src/services/eiaEIA API v2 service — route tree cache, Fuse.js index, facet fan-out, HTTP client.
src/services/canvas-bridgeDataCanvas bridge — registers EIA query results as DuckDB dataframes, routes SQL queries.
tests/Unit and integration tests mirroring src/.
docs/Design documents (design.md, idea.md).

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Always call eia_describe_route before eia_query_route — facet values require a separate API fan-out and are not embedded in route metadata
  • Wrap EIA responses: validate raw → normalize to domain type → return output schema; data values are strings — never coerce silently

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

来源:README.md,提交 0e70422

工具

6

eia_browse_routes

Browse EIA Routes

Lists child routes under a given path in the EIA dataset taxonomy. Start with no path to get the 14 top-level categories (electricity, petroleum, natural-gas, steo, aeo, ieo, seds, etc.), then drill into subcategories. Each result includes an isLeaf flag — leaf routes are queryable endpoints; non-leaf routes have children to browse. When isLeaf is true on the browsed path itself, switch to eia_describe_route. The first call after server start waits up to 20s for the route tree to warm, then answers from EIA directly.

输入参数path

eia_describe_route

Describe EIA Route

Returns metadata for a leaf route: available facets with their valid values, data column names and units, frequency options, and date range. Call this before eia_query_route to discover valid facet IDs, facet values, column IDs, and frequency codes. Each facet returns a capped window of its values with value_count and values_truncated alongside; pass facet and values_offset to page through the rest of one facet. To find a value by name in a large facet (plant, entity, and mine IDs run to thousands), pass values_query: each facet keeps only the values whose id, name, or alias contains it — on a balancing-authority facet, also a value whose ISO/RTO acronym does, so "ERCOT" finds ERCO — values_matched counts them, and values_offset pages the matches. A values_offset past the last value of a facet returns an empty window for it and a notice naming the count to page against. Facet values are fetched from separate EIA endpoints, merged, and cached per route for 24 hours, after which the next call fetches the route again; a facet whose values EIA did not return is left out of facets, named in unavailable_facets, and fetched again by the next call. When a refresh fails, the cached values are served instead, with a notice naming when they were fetched.

输入参数facetroute必填values_queryvalues_offset

eia_search_routes

Search EIA Routes

Fuzzy text search across route names, descriptions, category labels, and the names of the data columns a route publishes. Resolves natural-language queries like "electricity retail sales by state" or "natural gas imports" to matching route paths, and a measure named only by its column — "nameplate capacity", "gross generation" — to the route that publishes it. Multi-term queries are also matched term by term, so combining a commodity, a metric, and a sector — "electricity price residential", "coal generation industrial sector" — reaches the route carrying that data even when no single entry reads like the whole phrase. A query spelling the end of a route path in words — "retail sales" for electricity/retail-sales — ranks that route first. STEO, SEDS, and Monthly Energy Review (total-energy) series names are indexed so queries like "crude oil production forecast", "motor gasoline total consumption", or "primary energy consumption total" also resolve — a Monthly Energy Review series also by its ID, such as "TETCBUS" — and so are facet values, so a fuel type or sector term like "wind" or "anthracite coal" resolves to the route that exposes it, with filter_hint carrying the filter to pass on. That includes the series and product names of the daily and weekly petroleum and natural-gas routes and the RTO balancing authorities, so benchmarks like "Henry Hub", "WTI crude spot price", "Cushing", or "Electric Reliability Council of Texas" resolve before any describe; a balancing authority also answers to its EIA code or its ISO/RTO acronym ("ERCO", "ERCOT", "CAISO", "SPP"). A legacy APIv1 series ID as the EIA website and Excel add-in write them — "PET.RWTC.W", "ELEC.PRICE.TX-RES.M" — is resolved through the EIA series lookup into one result with its route, filter_hint, frequency, and columns, ready for eia_query_route, without waiting on the index. Results include isLeaf so you know whether to browse further or query directly. Results with score > 0.72 are weak matches — try

输入参数limitquery必填

eia_query_route

Query EIA Route Data

Fetches data from a leaf route with optional facet filters, date range, frequency, and column selection. Use eia_describe_route first to discover valid facet IDs, facet values, column IDs, and frequency codes. Data values are strings in the response (EIA API returns all numeric values as strings, e.g. "9.13"); cast to DOUBLE in SQL when arithmetic is needed. Returns a preview inline and stages nothing by default — one upstream request, whatever total says. Pass stage: true to also page past the preview and stage the accumulated set as a DataCanvas table, then pass the returned dataset name to eia_dataframe_describe for its column names and eia_dataframe_query for SQL. Every dataset a tenant stages lands in the same canvas, so tables from different routes cross-join by name with nothing to thread between calls.

输入参数endsortroute必填stagestartlengthoffsetcolumnsfiltersfrequency

eia_dataframe_describe

Describe EIA Dataframes

List canvas dataframes (df_<id>) materialized by eia_query_route calls that passed stage: true, with provenance, expiry, row count, and column schema. Nothing is staged until such a call runs, so an empty list on a fresh session means no query has staged yet, not that staging failed. Drops entries for dataframes the canvas no longer holds before responding, so the list is always current. Pass a specific name to inspect one dataframe; omit to list all active dataframes for this tenant. A name that is not staged comes back as found=false alongside the handles that are, never as an empty list. Listing is not use: only an eia_dataframe_query statement naming a dataframe extends its expiry, so a dataframe polled with this tool and never queried still lapses on schedule.

输入参数name

eia_dataframe_query

Query EIA Dataframes

Run a single-statement SELECT against canvas dataframes registered by eia_query_route calls that passed stage: true — a query that staged nothing leaves no table to select from. Standard DuckDB SQL — joins, aggregates, window functions, CTEs all supported. Reference dataframes by the df_<id> handles returned by eia_query_route or listed by eia_dataframe_describe. Read-only: writes, DDL, DROP, COPY, PRAGMA, ATTACH, file reads (read_* functions or a quoted file path), engine-setting functions (current_setting), and SQL built from a string (query_table) are rejected. System catalogs (information_schema, pg_catalog, sqlite_master, duckdb_*) are denied. EIA data values are VARCHAR — use CAST(col AS DOUBLE) for arithmetic and aggregation. Optional register_as chains results as a new dataframe with a fresh expiry. Every dataframe named in the statement has its expiry extended by the query. Inline rows stop at preview; a result cut short says how to reach the rest, including paging a register_as table with LIMIT/OFFSET and no ORDER BY, which keeps the order the preview showed.

输入参数sql必填previewrow_limitregister_as

版本历史

8
  1. v0.5.1最新Nov 4, 2026
  2. v0.5.0Oct 29, 2026
  3. v0.4.6Oct 23, 2026
  4. v0.4.5Oct 22, 2026
  5. v0.4.4Oct 13, 2026
  6. v0.4.3Oct 4, 2026
  7. v0.4.2Sep 20, 2026
  8. v0.4.1Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。