@commoditypriceapi/mcp 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.js +22 -4
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -102,11 +102,29 @@ export function createServer() {
|
|
|
102
102
|
});
|
|
103
103
|
server.registerTool("list_symbols", {
|
|
104
104
|
title: "List supported commodity symbols",
|
|
105
|
-
description: "Returns all commodity symbols supported by CommodityPriceAPI, including category, default currency, and unit. Use this to look up a symbol before calling rate tools. Precious metals use ISO 4217 codes (XAU, XAG, XPT, XPD); copper is XCU."
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
description: "Returns all commodity symbols supported by CommodityPriceAPI, including category, default currency, and unit. Use this to look up a symbol before calling rate tools. Precious metals use ISO 4217 codes (XAU, XAG, XPT, XPD); copper is XCU. " +
|
|
106
|
+
"Dated futures contracts (e.g. WTIOIL-FUT-DEC26, the December 2026 WTI contract) are listed as their own symbols with 'contract', 'deliveryMonth', 'expiresAt' and 'underlying' (the continuous parent such as WTIOIL-FUT); expired contracts are hidden unless includeExpired is set. Pass 'underlying' to list one parent's live months. A contract's latest price comes from get_latest_rates and its daily open/high/low/close (close = the exchange settlement) from get_historical_rates / get_time_series.",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
underlying: z
|
|
109
|
+
.string()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe("Only the dated futures contracts of this continuous parent symbol, e.g. 'WTIOIL-FUT'."),
|
|
112
|
+
contract: z
|
|
113
|
+
.enum(["spot", "futures"])
|
|
114
|
+
.optional()
|
|
115
|
+
.describe("Only symbols of this contract kind."),
|
|
116
|
+
includeExpired: z
|
|
117
|
+
.boolean()
|
|
118
|
+
.optional()
|
|
119
|
+
.describe("Also list expired futures contracts (hidden by default)."),
|
|
120
|
+
},
|
|
121
|
+
}, async ({ underlying, contract, includeExpired }) => {
|
|
108
122
|
try {
|
|
109
|
-
const data = await callCommodityApi("/symbols"
|
|
123
|
+
const data = await callCommodityApi("/symbols", {
|
|
124
|
+
underlying,
|
|
125
|
+
contract,
|
|
126
|
+
includeExpired: includeExpired ? "true" : undefined,
|
|
127
|
+
});
|
|
110
128
|
return textResult(data);
|
|
111
129
|
}
|
|
112
130
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commoditypriceapi/mcp",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Official MCP server for CommodityPriceAPI
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"description": "Official MCP server for CommodityPriceAPI — real-time and historical commodity rates (gold, silver, oil, and 130+ more) as MCP tools for Claude, Cursor, Windsurf, and any MCP client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
7
7
|
"model-context-protocol",
|