scheduledTransaction.discard
Drop a held Since Last Run proposal.
Drops a held Since Last Run proposal without applying it. Proposals are also dropped when applied, when 16 newer ones push them out and when the book closes, so discarding is only for tidiness. It changes nothing in the book.
Examples
Example: with a new, empty book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"scheduledTransaction.discard","params":{"proposal":"slr-999999"}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 2000,
"message": "…",
"data": {
"kind": "sinceLastRunProposal",
"id": "slr-999999",
"help": "error/not-found"
}
}
}
Command line
red-ale exec --book book.gnucash scheduledTransaction.discard '{"proposal":"slr-999999"}'
It fails with exit status 2, printing on standard error:
{
"error": {
"code": 2000,
"message": "…",
"data": {
"kind": "sinceLastRunProposal",
"id": "slr-999999",
"help": "error/not-found"
}
}
}
MCP tool call
Tool call:
{"name":"scheduledTransaction.discard","arguments":{"proposal":"slr-999999"}}
Result:
{
"isError": true,
"structuredContent": {
"error": {
"code": 2000,
"name": "not-found",
"message": "…",
"data": {
"kind": "sinceLastRunProposal",
"id": "slr-999999",
"help": "error/not-found"
}
}
}
}
A held proposal is dropped, and is then gone:
Example: with a new, empty book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"scheduledTransaction.sinceLastRun","params":{}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"id": "slr-1",
"…": "…"
}
}
Request:
{"jsonrpc":"2.0","id":2,"method":"scheduledTransaction.discard","params":{"proposal":"slr-1"}}
Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"discarded": true
}
}
Request:
{"jsonrpc":"2.0","id":3,"method":"scheduledTransaction.apply","params":{"proposal":"slr-1"}}
Response:
{
"jsonrpc": "2.0",
"id": 3,
"error": {
"code": 2000,
"message": "…",
"data": {
"kind": "sinceLastRunProposal",
"id": "slr-1",
"help": "error/not-found"
}
}
}
Command line
red-ale exec --book book.gnucash --script - <<'EOF'
scheduledTransaction.sinceLastRun {}
scheduledTransaction.discard {"proposal":"slr-1"}
scheduledTransaction.apply {"proposal":"slr-1"}
EOF
It fails with exit status 2, printing on standard error:
{
"error": {
"code": 2000,
"message": "…",
"data": {
"kind": "sinceLastRunProposal",
"id": "slr-1",
"help": "error/not-found"
}
}
}
MCP tool call
Tool call:
{"name":"scheduledTransaction.sinceLastRun","arguments":{}}
Result:
{
"structuredContent": {
"id": "slr-1",
"…": "…"
}
}
Tool call:
{"name":"scheduledTransaction.discard","arguments":{"proposal":"slr-1"}}
Result:
{
"structuredContent": {
"discarded": true
}
}
Tool call:
{"name":"scheduledTransaction.apply","arguments":{"proposal":"slr-1"}}
Result:
{
"isError": true,
"structuredContent": {
"error": {
"code": 2000,
"name": "not-found",
"message": "…",
"data": {
"kind": "sinceLastRunProposal",
"id": "slr-1",
"help": "error/not-found"
}
}
}
}
Effect: read.
Params
The params of scheduledTransaction.discard.
proposal(string, required): The proposal's ID.
Result
The result of scheduledTransaction.discard.
discarded(boolean, required): Always true.