Skip to main content
Glama
OilpriceAPI

OilPriceAPI

Official
by OilpriceAPI

Get Price History

opa_get_history
Read-only

Get historical commodity prices for any period—day, week, month, or year—to analyze trends and performance. Returns high, low, average, change, and data point count.

Instructions

Get historical price data for a commodity over a time period. Use when the user asks about price trends, historical prices, or how a commodity has performed over time. Returns high, low, average, change, and data point count. Periods: day (24h), week (7d), month (30d), year (365d). Supports point-in-time filtering via stored observation and revision timestamps. Observation-dated bulk backfills may appear in an earlier as_of result because their actual load time cannot be reconstructed. Requires an eligible account entitlement. Use opa_get_plans for current access and pricing; the API response is authoritative.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
as_ofNoOptional ISO8601 date/datetime for filtering by stored observation and covered revision timestamps, e.g. '2026-06-02'. Must not be in the future. Observation-dated bulk backfills may appear in an earlier as_of result because actual load time cannot be reconstructed. Revision-correction coverage since 2026-07-28.
periodNoTime period: day, week, month, or year (default: month)month
commodityYesCommodity name or code (e.g., 'brent', 'WTI_USD')

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.2.4
    • changedInput schema / properties / as_of / description
      Previous value: -"Optional ISO8601 date/datetime for a point-in-time (vintage) view, e.g. '2026-06-02'. Returns the series as it was knowable then: rows collected later are absent and values revised later are rolled back. Must not be in the future. Revision-correction coverage since 2026-07-28."New value: +"Optional ISO8601 date/datetime for filtering by stored observation and covered revision timestamps, e.g. '2026-06-02'. Must not be in the future. Observation-dated bulk backfills may appear in an earlier as_of result because actual load time cannot be reconstructed. Revision-correction coverage since 2026-07-28."
  2. Changed1 schema field changedv3.2.0
    • addedInput schema / properties / as_of
      Added value: +{
      +  "description": "Optional ISO8601 date/datetime for a point-in-time (vintage) view, e.g. '2026-06-02'. Returns the series as it was knowable then: rows collected later are absent and values revised later are rolled back. Must not be in the future. Revision-correction coverage since 2026-07-28.",
      +  "type": "string"
      +}
  3. Changed1 schema field changedv3.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
  4. First observedv2.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description discloses the returned metrics, supported periods, point-in-time filtering behavior, backfill caveats, entitlement requirements, and authority of the API response. This is substantial, non-obvious behavioral context.

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 compact and front-loaded with the primary purpose, followed by usage, return shape, period details, caveats, and alternatives. Every sentence adds relevant information and the text avoids fluff.

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?

With no output schema, the description still tells the agent what the response contains (high, low, average, change, data point count). It also covers edge cases like backfill timing, account entitlement, and which tool to use for current pricing, making it sufficiently complete for correct invocation.

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

Parameters4/5

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

The schema already documents all three parameters with descriptions, so the baseline is 3. The description adds value by expanding period meanings (day=24h, week=7d, month=30d, year=365d) and clarifying point-in-time filtering semantics beyond the schema.

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: 'Get historical price data for a commodity over a time period.' It also frames usage around price trends and historical performance, which clearly separates it from siblings like opa_get_price and opa_get_plans.

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

Usage Guidelines4/5

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

It explicitly says to use this tool when the user asks about price trends, historical prices, or performance over time, and it points to opa_get_plans for current access and pricing. It does not enumerate when-not cases for other price-related siblings, but the guidance is otherwise clear.

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