Skip to main content
Glama
OilpriceAPI

OilPriceAPI

Official
by OilpriceAPI

Get Price History

opa_get_history
Read-only

Retrieve historical price data for any commodity over day, week, month, or year periods. Includes high, low, average, change, and data point count, plus point-in-time views for backtesting.

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 (vintage) queries via as_of: the series as it was knowable at that instant — later-collected rows absent, later revisions rolled back (no lookahead bias; built for backtests). Requires a paid plan (Developer, $19/mo, and up) — the free tier serves latest prices only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
as_ofNoOptional 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.
periodNoTime period: day, week, month, or year (default: month)month
commodityYesCommodity name or code (e.g., 'brent', 'WTI_USD')
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses specific return fields (high, low, average, change, data point count), explains period durations (day=24h, week=7d, etc.), and gives a detailed account of as_of vintage semantics (later rows absent, revisions rolled back, no lookahead bias). It also adds the critical paid-plan restriction for historical data, which is substantial behavioral and operational 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 but information-dense: each sentence earns its place, covering purpose, trigger, outputs, periods, as_of behavior, and pricing. It is front-loaded with the core action and avoids repetition or filler.

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?

Given no output schema, the description still lists the return fields and key behavioral nuances, including the vintage feature and plan limitation. For a 3-parameter tool with full schema coverage, this is complete and well-positioned among 32 sibling tools.

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?

Schema coverage is 100%, so the baseline is 3. The description enhances this by mapping periods to human-readable durations and reinforcing as_of semantics with backtesting context that goes beyond the schema's description. It doesn't add new syntax details but adds interpretive value, warranting a 4.

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 uses a specific verb and resource: 'Get historical price data for a commodity over a time period.' It clearly differentiates from siblings like opa_get_price by emphasizing 'historical', 'price trends', and 'performed over time', making the tool's niche obvious.

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 states when to use: 'Use when the user asks about price trends, historical prices, or how a commodity has performed over time.' It also notes the paid-plan requirement as a constraint. However, it does not name an alternative tool for current prices (e.g., opa_get_price), so it lacks an explicit 'when not to use' statement, though the context strongly implies it.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/OilpriceAPI/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server