Metals-API · Capability

Metals-API — Rates

Metals-API — Rates. 3 operations. Lead operation: Get gold prices by carat. Self-contained Naftiko capability covering one Metals Api business surface.

Run with Naftiko Metals ApiRates

What You Can Do

GET
Getcarat — Get gold prices by carat
/v1/carat
GET
Getlatest — Get latest rates
/v1/latest
GET
Gethistoricalrates — Get historical rates by date
/v1/{date}

MCP Tools

get-gold-prices-carat

Get gold prices by carat

read-only idempotent
get-latest-rates

Get latest rates

read-only idempotent
get-historical-rates-date

Get historical rates by date

read-only idempotent

Capability Spec

metals-rates.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Metals-API — Rates
  description: 'Metals-API — Rates. 3 operations. Lead operation: Get gold prices by carat. Self-contained Naftiko capability
    covering one Metals Api business surface.'
  tags:
  - Metals Api
  - Rates
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    METALS_API_API_KEY: METALS_API_API_KEY
capability:
  consumes:
  - type: http
    namespace: metals-rates
    baseUri: https://metals-api.com/api
    description: Metals-API — Rates business capability. Self-contained, no shared references.
    resources:
    - name: carat
      path: /carat
      operations:
      - name: getcarat
        method: GET
        description: Get gold prices by carat
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: latest
      path: /latest
      operations:
      - name: getlatest
        method: GET
        description: Get latest rates
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: unit
          in: query
          type: string
          description: Unit of measure (e.g., troy_ounce, gram, kilogram).
    - name: date
      path: /{date}
      operations:
      - name: gethistoricalrates
        method: GET
        description: Get historical rates by date
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: date
          in: path
          type: string
          description: Date in YYYY-MM-DD format.
          required: true
    authentication:
      type: apikey
      key: access_key
      value: '{{env.METALS_API_API_KEY}}'
      placement: query
  exposes:
  - type: rest
    namespace: metals-rates-rest
    port: 8080
    description: REST adapter for Metals-API — Rates. One Spectral-compliant resource per consumed operation, prefixed with
      /v1.
    resources:
    - path: /v1/carat
      name: carat
      description: REST surface for carat.
      operations:
      - method: GET
        name: getcarat
        description: Get gold prices by carat
        call: metals-rates.getcarat
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/latest
      name: latest
      description: REST surface for latest.
      operations:
      - method: GET
        name: getlatest
        description: Get latest rates
        call: metals-rates.getlatest
        with:
          unit: rest.unit
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/{date}
      name: date
      description: REST surface for date.
      operations:
      - method: GET
        name: gethistoricalrates
        description: Get historical rates by date
        call: metals-rates.gethistoricalrates
        with:
          date: rest.date
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: metals-rates-mcp
    port: 9090
    transport: http
    description: MCP adapter for Metals-API — Rates. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: get-gold-prices-carat
      description: Get gold prices by carat
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: metals-rates.getcarat
      outputParameters:
      - type: object
        mapping: $.
    - name: get-latest-rates
      description: Get latest rates
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: metals-rates.getlatest
      with:
        unit: tools.unit
      outputParameters:
      - type: object
        mapping: $.
    - name: get-historical-rates-date
      description: Get historical rates by date
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: metals-rates.gethistoricalrates
      with:
        date: tools.date
      outputParameters:
      - type: object
        mapping: $.