Skip to main content
Glama

OilPriceAPI hosted energy data

Get Latest Price by Code

energy_get_latest
Read-onlyIdempotent

Read the latest price for one exact commodity code from the catalog (find codes with energy_search_catalog). Preserve dataset name, currency, unit and all source/freshness fields; latest is not necessarily spot or settlement. Requires a connected account; access follows the account's plan.

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": {
      "code": "<code>"
    },
    "name": "energy_get_latest"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes

Output Schema

NameRequiredDescriptionDefault
accessNo
datasetNo
messageNo
outcomeNo
handoff_urlYes
upgrade_urlNo
website_urlYes
availabilityNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "access": {
      +      "enum": [
      +        "demo",
      +        "authenticated"
      +      ],
      +      "type": "string"
      +    },
      +    "availability": {
      +      "enum": [
      +        "available",
      +        "unavailable"
      +      ],
      +      "type": "string"
      +    },
      +    "dataset": {
      +      "type": "string"
      +    },
      +    "handoff_url": {
      +      "type": "string"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "outcome": {
      +      "type": "string"
      +    },
      +    "upgrade_url": {
      +      "type": "string"
      +    },
      +    "website_url": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "website_url",
      +    "handoff_url"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world, so the bar is lower; the description still adds real context with the account/plan prerequisite and the warning that 'latest is not necessarily spot or settlement'. That caveat plus the instruction to preserve dataset name, currency, unit and freshness fields is information the annotations cannot convey.

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?

Three sentences, front-loaded with the core action, then the code-lookup routing, then the auth and semantic caveats. No sentence is redundant, and the caution about spot vs settlement earns its place.

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

Completeness4/5

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

An output schema exists, so return-value explanation is unnecessary, and the description covers input sourcing, access prerequisites and a key semantic caveat. What remains unstated is how this relates to the similarly named energy_get_price, which would round out an otherwise complete definition.

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 0%, so the description must carry the meaning of the single parameter, and it does: it specifies one exact code rather than a pattern or name, and points to the tool that produces valid codes. The regex constraint lives in the schema, but the description compensates for the missing prose there.

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 pairs a specific verb (read) with a specific resource (latest price for one exact commodity code) and scopes it to the catalog, which cleanly separates it from the catalog-search sibling it names. An agent can distinguish it from energy_search_catalog without opening either schema.

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 routes the agent to energy_search_catalog for obtaining codes, giving a clear precondition for successful use. It stops short of stating when to prefer this over energy_get_price or the history/curve siblings, so guidance is strong but incomplete.

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.