budget.delete
Delete a budget; the last unsets the Book feature for natural signs.
Deletes a budget with all its amounts and notes. Deleting the last budget unsets the book feature Use natural signs in budget amounts, as GnuCash does (featureUnset says so). The book option Default Budget is left alone even if it
names the deleted budget; a stale one falls back to the first budget.
Examples
Example: with a new, empty book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"budget.create","params":{"name":"2024"}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": "…"
}
Request:
{"jsonrpc":"2.0","id":2,"method":"budget.delete","params":{"budget":"00ed0000000000000000000000000001"}}
Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"deleted": true,
"featureUnset": true
}
}
Command line
red-ale exec --book book.gnucash --script - <<'EOF'
budget.create {"name":"2024"}
budget.delete {"budget":"00ed0000000000000000000000000001"}
EOF
It prints:
[
"…",
{
"deleted": true,
"featureUnset": true
}
]
MCP tool call
Tool call:
{"name":"budget.create","arguments":{"name":"2024"}}
Result:
{
"content": [
{
"type": "text",
"text": "\"…\""
}
]
}
Tool call:
{"name":"budget.delete","arguments":{"budget":"00ed0000000000000000000000000001"}}
Result:
{
"structuredContent": {
"deleted": true,
"featureUnset": true
}
}
Effect: destructive, on the Book.
Params
Names one budget.
budget(Guid, required): The budget.
Result
The result of budget.delete.
deleted(boolean, required): Always true.featureUnset(boolean, required): The last budget went, so the featureUse natural signs in budget amountswas unset.