budget.list
Every budget in book order, and which is the default.
Lists the budgets in book order, without their periods, amounts and notes, with the default one (the budget the budget
reports use unless told otherwise). defaultFrom says whether the book names it (option) or it is just the first
(first). Set the default with book.setOptions.
needsSignScrub is true when the book has budgets but not the natural-signs feature, so that edits are refused until
budget.scrubSigns runs. Listing and reading work either way.
Examples
Example: with a copy of the reports/budget example book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"budget.list","params":{}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"budgets": [
{
"guid": "f0000000000000000000000000000000",
"name": "test budget",
"numPeriods": 6,
"isDefault": true,
"…": "…"
}
],
"default": "f0000000000000000000000000000000",
"defaultFrom": "first",
"naturalSigns": false,
"needsSignScrub": true
}
}
Command line
red-ale exec --book book.gnucash budget.list
It prints:
{
"budgets": [
{
"guid": "f0000000000000000000000000000000",
"name": "test budget",
"numPeriods": 6,
"isDefault": true,
"…": "…"
}
],
"default": "f0000000000000000000000000000000",
"defaultFrom": "first",
"naturalSigns": false,
"needsSignScrub": true
}
MCP tool call
Tool call:
{"name":"budget.list","arguments":{}}
Result:
{
"structuredContent": {
"budgets": [
{
"guid": "f0000000000000000000000000000000",
"name": "test budget",
"numPeriods": 6,
"isDefault": true,
"…": "…"
}
],
"default": "f0000000000000000000000000000000",
"defaultFrom": "first",
"naturalSigns": false,
"needsSignScrub": true
}
}
Effect: read.
Params
Params for methods that take none.
Type: NoParams.
Result
The result of budget.list.
budgets(array of BudgetInfo, required): Every budget, in book order, without periods, amounts and notes.default(Guid or null): The default budget's GUID, or null when the book has none.defaultFrom(DefaultFromWire or null): Where the default comes from, or null.naturalSigns(boolean, required): Whether the book has the featureUse natural signs in budget amounts.needsSignScrub(boolean, required): True when the book has budgets and lacks the feature: edits are refused untilbudget.scrubSigns.