Method

report.deleteStyleSheet

Delete a user style sheet, or reset a predefined one to its template's defaults.

Deletes a style sheet you made. A predefined one cannot be deleted, so it goes back to its template's defaults instead (reset: true), which is what GnuCash does on its next start. Saved configurations that name a deleted style sheet render with the base look.

Examples

Example: with no book.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"report.createStyleSheet","params":{"name":"Roomy","template":"Plain"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "…"
}

Request:

{"jsonrpc":"2.0","id":2,"method":"report.deleteStyleSheet","params":{"name":"Roomy"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "deleted": {
      "name": "Roomy",
      "…": "…"
    },
    "reset": false
  }
}

Request:

{"jsonrpc":"2.0","id":3,"method":"report.deleteStyleSheet","params":{"name":"Easy"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "deleted": {
      "name": "Easy",
      "predefined": true,
      "…": "…"
    },
    "reset": true
  }
}

Command line

red-ale exec --script - <<'EOF'
report.createStyleSheet {"name":"Roomy","template":"Plain"}
report.deleteStyleSheet {"name":"Roomy"}
report.deleteStyleSheet {"name":"Easy"}
EOF

It prints:

[
  "…",
  {
    "deleted": {
      "name": "Roomy",
      "…": "…"
    },
    "reset": false
  },
  {
    "deleted": {
      "name": "Easy",
      "predefined": true,
      "…": "…"
    },
    "reset": true
  }
]

MCP tool call

Tool call:

{"name":"report.createStyleSheet","arguments":{"name":"Roomy","template":"Plain"}}

Result:

{
  "content": [
    {
      "type": "text",
      "text": "\"…\""
    }
  ]
}

Tool call:

{"name":"report.deleteStyleSheet","arguments":{"name":"Roomy"}}

Result:

{
  "structuredContent": {
    "deleted": {
      "name": "Roomy",
      "…": "…"
    },
    "reset": false
  }
}

Tool call:

{"name":"report.deleteStyleSheet","arguments":{"name":"Easy"}}

Result:

{
  "structuredContent": {
    "deleted": {
      "name": "Easy",
      "predefined": true,
      "…": "…"
    },
    "reset": true
  }
}

Effect: destructive, on the Configuration only.

Params

Params of report.deleteStyleSheet.

  • name (string, required): The style sheet.

Result

The result of report.deleteStyleSheet.

  • deleted (StyleSheetInfo, required): The style sheet as it was.
  • reset (boolean, required): True when it is predefined and so went back to its template's defaults rather than going away.