period.get
The configured accounting period and fiscal year end.
Reads the accounting period: the start and end bounds that reports and account totals use by default (GnuCash's
Accounting Period preferences), and the fiscal year end. A bound is a relative choice (today, month,
previous-month, quarter, previous-quarter, year, previous-year, fiscal-year, previous-fiscal-year) or a
YYYY-MM-DD date. The default is year for both. GnuCash keeps these as user preferences, not in the book; red-ale
keeps them in its Configuration, so the call works with no book open.
Examples
Example: with no book.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"period.get","params":{}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"start": "year",
"end": "year",
"fiscalYearEnd": null,
"fiscalYearEndSource": null,
"choices": [
"today",
"month",
"previous-month",
"quarter",
"previous-quarter",
"year",
"previous-year",
"fiscal-year",
"previous-fiscal-year"
],
"…": "…"
}
}
Command line
red-ale exec period.get
It prints:
{
"start": "year",
"end": "year",
"fiscalYearEnd": null,
"fiscalYearEndSource": null,
"choices": [
"today",
"month",
"previous-month",
"quarter",
"previous-quarter",
"year",
"previous-year",
"fiscal-year",
"previous-fiscal-year"
],
"…": "…"
}
MCP tool call
Tool call:
{"name":"period.get","arguments":{}}
Result:
{
"structuredContent": {
"start": "year",
"end": "year",
"fiscalYearEnd": null,
"fiscalYearEndSource": null,
"choices": [
"today",
"month",
"previous-month",
"quarter",
"previous-quarter",
"year",
"previous-year",
"fiscal-year",
"previous-fiscal-year"
],
"…": "…"
}
}
Effect: read.
Params
Params for methods that take none.
Type: NoParams.
Result
The accounting period setting.
start(string, required): Start: a relative choice (today,month,previous-month,quarter,previous-quarter,year,previous-year,fiscal-year,previous-fiscal-year) or aYYYY-MM-DDdate.end(string, required): End, in the same form; a relative choice means the period's last day.fiscalYearEnd(string or null): The fiscal year end in use (MM-DD), if any.fiscalYearEndSource(string or null): Where it comes from:config, orbook(the open book'sfy_endslot).configFile(string or null): The configuration file, if the setting is kept in one; otherwise it lasts as long as the server.choices(array of string, required): Every relative choice, in GnuCash's order.