Method

price.fetchStatus

A Quote fetch's state and, per commodity, the price stored or why there is none.

Reports a quote fetch: whether it is running or finished and, for each commodity, the price stored or why none was. fetch is the ID price.fetchQuotes returned; leave it out for the latest fetch. With no fetch started it fails with not-found.

Examples

Example: with a copy of the reports/test-data example book open as book.gnucash.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"price.fetchStatus","params":{}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": 2000,
    "message": "…",
    "data": {
      "kind": "quoteFetch",
      "id": "latest",
      "help": "error/not-found"
    }
  }
}

Command line

red-ale exec --book book.gnucash price.fetchStatus

It fails with exit status 2, printing on standard error:

{
  "error": {
    "code": 2000,
    "message": "…",
    "data": {
      "kind": "quoteFetch",
      "id": "latest",
      "help": "error/not-found"
    }
  }
}

MCP tool call

Tool call:

{"name":"price.fetchStatus","arguments":{}}

Result:

{
  "isError": true,
  "structuredContent": {
    "error": {
      "code": 2000,
      "name": "not-found",
      "message": "…",
      "data": {
        "kind": "quoteFetch",
        "id": "latest",
        "help": "error/not-found"
      }
    }
  }
}

Effect: read.

Params

Params of price.fetchStatus.

  • fetch (string or null): The Quote fetch; default the latest.

Result

A Quote fetch.

  • fetch (string, required): Its ID.
  • state (FetchState, required): running or finished.
  • started (Timestamp, required): When it started.
  • finished (Timestamp or null): When its prices were stored; null while running.
  • commodities (array of CommodityFetch, required): One entry per commodity, in the order fetched.
  • stored (integer (uint) or null): Commodities whose price went through price.add's rules, once finished.
  • failed (integer (uint) or null): Commodities with no price, once finished.