Skip to main content
Glama

ynab_delete_transaction

DestructiveIdempotent

Delete a YNAB transaction by ID, with optional preview and confirmation before the irreversible action.

Instructions

Delete a transaction from YNAB. This action is irreversible.

Args:

  • budget_id (string, optional): Budget UUID. Omit to use the default budget.

  • transaction_id (string, required): Transaction UUID to delete.

  • dry_run (boolean, optional): Preview without deleting. Default: false.

Returns: the deleted transaction with its ID and deletion status.

Errors:

  • "Transaction not found" → invalid transaction_id

Write safety: call without confirmation_token to preview. The preview returns confirmation_token and confirmation_expires_at in its structured output (and in its text). Execute the identical validated request with that short-lived confirmation_token.

Input Schema

NameRequiredDescriptionDefault
dry_runNo
budget_idNo
transaction_idYes
confirmation_tokenNoShort-lived, single-use token returned by the immediately preceding preview of this exact validated request. Omit, or pass null or an empty string, to preview.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.32.0
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "action": {
      -        "const": "ynab_delete_transaction",
      -        "type": "string"
      -      },
      -      "dry_run": {
      -        "const": true,
      -        "type": "boolean"
      -      },
      -      "request": {
      -        "additionalProperties": {},
      -        "propertyNames": {
      -          "type": "string"
      -        },
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "dry_run",
      -      "action",
      -      "request"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "message": {
      -        "type": "string"
      -      },
      -      "transaction": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "account_id": {
      -            "type": "string"
      -          },
      -          "account_name": {
      -            "type": "string"
      -          },
      -          "amount": {
      -            "description": "Amount in decimal currency units",
      -            "type": "number"
      -          },
      -          "amount_currency": {
      -            "type": "number"
      -          },
      -          "amount_formatted": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "amount_milliunits": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "approved": {
      -            "type": "boolean"
      -          },
      -          "category_id": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "category_name": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "cleared": {
      -            "type": "string"
      -          },
      -          "date": {
      -            "type": "string"
      -          },
      -          "debt_transaction_type": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "deleted": {
      -            "type": "boolean"
      -          },
      -          "flag_color": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "flag_name": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "id": {
      -            "type": "string"
      -          },
      -          "import_id": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "import_payee_name": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "import_payee_name_original": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "matched_transaction_id": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "memo": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "parent_transaction_id": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "payee_id": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "payee_name": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "scheduled_transaction_id": {
      -            "type": "string"
      -          },
      -          "subtransactions": {
      -            "items": {
      -              "additionalProperties": false,
      -              "properties": {
      -                "amount": {
      -                  "description": "Amount in decimal currency units",
      -                  "type": "number"
      -                },
      -                "amount_currency": {
      -                  "type": "number"
      -                },
      -                "amount_formatted": {
      -                  "type": [
      -                    "string",
      -                    "null"
      -                  ]
      -                },
      -                "amount_milliunits": {
      -                  "maximum": 9007199254740991,
      -                  "minimum": -9007199254740991,
      -                  "type": "integer"
      -                },
      -                "category_id": {
      -                  "type": [
      -                    "string",
      -                    "null"
      -                  ]
      -                },
      -                "category_name": {
      -                  "type": [
      -                    "string",
      -                    "null"
      -                  ]
      -                },
      -                "deleted": {
      -                  "type": "boolean"
      -                },
      -                "id": {
      -                  "type": "string"
      -                },
      -                "memo": {
      -                  "type": [
      -                    "string",
      -                    "null"
      -                  ]
      -                },
      -                "payee_id": {
      -                  "type": [
      -                    "string",
      -                    "null"
      -                  ]
      -                },
      -                "payee_name": {
      -                  "type": [
      -                    "string",
      -                    "null"
      -                  ]
      -                },
      -                "scheduled_transaction_id": {
      -                  "type": "string"
      -                },
      -                "transaction_id": {
      -                  "type": "string"
      -                },
      -                "transfer_account_id": {
      -                  "type": [
      -                    "string",
      -                    "null"
      -                  ]
      -                },
      -                "transfer_transaction_id": {
      -                  "type": [
      -                    "string",
      -                    "null"
      -                  ]
      -                }
      -              },
      -              "required": [
      -                "amount"
      -              ],
      -              "type": "object"
      -            },
      -            "type": "array"
      -          },
      -          "transaction_id": {
      -            "type": "string"
      -          },
      -          "transfer_account_id": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "transfer_transaction_id": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "type": {
      -            "enum": [
      -              "transaction",
      -              "subtransaction"
      -            ],
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "id",
      -          "deleted"
      -        ],
      -        "type": "object"
      -      },
      -      "updated_balance": {
      -        "type": "number"
      -      },
      -      "updated_cleared_balance": {
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "message",
      -      "transaction"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "action": {
      +        "const": "ynab_delete_transaction",
      +        "type": "string"
      +      },
      +      "confirmation_expires_at": {
      +        "description": "Preview only: when confirmation_token expires (ISO 8601).",
      +        "format": "date-time",
      +        "type": "string"
      +      },
      +      "confirmation_token": {
      +        "description": "Preview only: single-use token that executes this exact request when passed back as confirmation_token.",
      +        "type": "string"
      +      },
      +      "dry_run": {
      +        "const": true,
      +        "type": "boolean"
      +      },
      +      "request": {
      +        "additionalProperties": {},
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "dry_run",
      +      "action",
      +      "request"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "confirmation_expires_at": {
      +        "description": "Preview only: when confirmation_token expires (ISO 8601).",
      +        "format": "date-time",
      +        "type": "string"
      +      },
      +      "confirmation_token": {
      +        "description": "Preview only: single-use token that executes this exact request when passed back as confirmation_token.",
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "transaction": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "account_id": {
      +            "type": "string"
      +          },
      +          "account_name": {
      +            "type": "string"
      +          },
      +          "amount": {
      +            "description": "Amount in decimal currency units",
      +            "type": "number"
      +          },
      +          "amount_currency": {
      +            "type": "number"
      +          },
      +          "amount_formatted": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "amount_milliunits": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "approved": {
      +            "type": "boolean"
      +          },
      +          "category_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "category_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "cleared": {
      +            "type": "string"
      +          },
      +          "date": {
      +            "type": "string"
      +          },
      +          "debt_transaction_type": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "deleted": {
      +            "type": "boolean"
      +          },
      +          "flag_color": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "flag_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "import_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "import_payee_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "import_payee_name_original": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "matched_transaction_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "memo": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "parent_transaction_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "payee_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "payee_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "scheduled_transaction_id": {
      +            "type": "string"
      +          },
      +          "subtransactions": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "amount": {
      +                  "description": "Amount in decimal currency units",
      +                  "type": "number"
      +                },
      +                "amount_currency": {
      +                  "type": "number"
      +                },
      +                "amount_formatted": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "amount_milliunits": {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "category_id": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "category_name": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "deleted": {
      +                  "type": "boolean"
      +                },
      +                "id": {
      +                  "type": "string"
      +                },
      +                "memo": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "payee_id": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "payee_name": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "scheduled_transaction_id": {
      +                  "type": "string"
      +                },
      +                "transaction_id": {
      +                  "type": "string"
      +                },
      +                "transfer_account_id": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "transfer_transaction_id": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                }
      +              },
      +              "required": [
      +                "amount"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "transaction_id": {
      +            "type": "string"
      +          },
      +          "transfer_account_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "transfer_transaction_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "type": {
      +            "enum": [
      +              "transaction",
      +              "subtransaction"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "deleted"
      +        ],
      +        "type": "object"
      +      },
      +      "updated_balance": {
      +        "type": "number"
      +      },
      +      "updated_cleared_balance": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "message",
      +      "transaction"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed5 schema fields changedv0.31.0
    • addedInput schema / properties / confirmation_token / anyOf
      Added value: +[
      +  {
      +    "minLength": 16,
      +    "type": "string"
      +  },
      +  {
      +    "const": ""
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / confirmation_token / description
      Previous value: -"Short-lived, single-use token returned by the immediately preceding preview of this exact validated request."New value: +"Short-lived, single-use token returned by the immediately preceding preview of this exact validated request. Omit, or pass null or an empty string, to preview."
    • removedInput schema / properties / confirmation_token / minLength
      Removed value: -16
    • removedInput schema / properties / confirmation_token / type
      Removed value: -"string"
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "action": {
      -        "const": "ynab_delete_transaction",
      -        "type": "string"
      -      },
      -      "dry_run": {
      -        "const": true,
      -        "type": "boolean"
      -      },
      -      "request": {
      -        "additionalProperties": {},
      -        "propertyNames": {
      -          "type": "string"
      -        },
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "dry_run",
      -      "action",
      -      "request"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "message": {
      -        "type": "string"
      -      },
      -      "transaction": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "deleted": {
      -            "type": "boolean"
      -          },
      -          "id": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "id",
      -          "deleted"
      -        ],
      -        "type": "object"
      -      },
      -      "updated_balance": {
      -        "type": "number"
      -      },
      -      "updated_cleared_balance": {
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "message",
      -      "transaction",
      -      "updated_balance",
      -      "updated_cleared_balance"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "action": {
      +        "const": "ynab_delete_transaction",
      +        "type": "string"
      +      },
      +      "dry_run": {
      +        "const": true,
      +        "type": "boolean"
      +      },
      +      "request": {
      +        "additionalProperties": {},
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "dry_run",
      +      "action",
      +      "request"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "message": {
      +        "type": "string"
      +      },
      +      "transaction": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "account_id": {
      +            "type": "string"
      +          },
      +          "account_name": {
      +            "type": "string"
      +          },
      +          "amount": {
      +            "description": "Amount in decimal currency units",
      +            "type": "number"
      +          },
      +          "amount_currency": {
      +            "type": "number"
      +          },
      +          "amount_formatted": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "amount_milliunits": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "approved": {
      +            "type": "boolean"
      +          },
      +          "category_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "category_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "cleared": {
      +            "type": "string"
      +          },
      +          "date": {
      +            "type": "string"
      +          },
      +          "debt_transaction_type": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "deleted": {
      +            "type": "boolean"
      +          },
      +          "flag_color": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "flag_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "import_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "import_payee_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "import_payee_name_original": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "matched_transaction_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "memo": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "parent_transaction_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "payee_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "payee_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "scheduled_transaction_id": {
      +            "type": "string"
      +          },
      +          "subtransactions": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "amount": {
      +                  "description": "Amount in decimal currency units",
      +                  "type": "number"
      +                },
      +                "amount_currency": {
      +                  "type": "number"
      +                },
      +                "amount_formatted": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "amount_milliunits": {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "category_id": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "category_name": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "deleted": {
      +                  "type": "boolean"
      +                },
      +                "id": {
      +                  "type": "string"
      +                },
      +                "memo": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "payee_id": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "payee_name": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "scheduled_transaction_id": {
      +                  "type": "string"
      +                },
      +                "transaction_id": {
      +                  "type": "string"
      +                },
      +                "transfer_account_id": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "transfer_transaction_id": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                }
      +              },
      +              "required": [
      +                "amount"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "transaction_id": {
      +            "type": "string"
      +          },
      +          "transfer_account_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "transfer_transaction_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "type": {
      +            "enum": [
      +              "transaction",
      +              "subtransaction"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "deleted"
      +        ],
      +        "type": "object"
      +      },
      +      "updated_balance": {
      +        "type": "number"
      +      },
      +      "updated_cleared_balance": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "message",
      +      "transaction"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. Changed1 schema field changedv0.27.1
    • addedInput schema / properties / confirmation_token
      Added value: +{
      +  "description": "Short-lived, single-use token returned by the immediately preceding preview of this exact validated request.",
      +  "minLength": 16,
      +  "type": "string"
      +}
  4. Addedv0.26.9

TDQS

A4.2/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare destructiveHint=true, readOnlyHint=false and idempotentHint=true, and the description still adds material context beyond them: the action is irreversible, a two-step confirmation handshake is required, the token is short-lived and single-use, and a named error ("Transaction not found") maps to an invalid transaction_id. It also states the return payload, which is real behavioral disclosure rather than restated annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the verb and the irreversible warning, then organized into Args / Returns / Errors / Write safety, which is easy to scan. Some content is redundant — the Returns line restates an existing output schema, and the parameter list largely repeats schema types — so not every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive 4-parameter tool, the description covers the safety flow, the error case and the return shape, and an output schema exists so return details need not be expanded. The one real gap is that the interaction between dry_run and confirmation_token, and any TTL for the confirmation window, is never stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 25% (only confirmation_token is documented in-schema), so the description must compensate, and it largely does: budget_id gains the meaningful "omit to use the default budget" default, dry_run gains "preview without deleting" with a stated default of false, and transaction_id is marked required. confirmation_token is handled in the schema itself, but the description never reconciles dry_run against the token preview, leaving two overlapping preview mechanisms unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Delete a transaction from YNAB") and immediately flags irreversibility, which lets an agent separate it from update_transaction, get_transaction and create_transaction without opening a schema. It stops short of naming the closest look-alike, ynab_delete_scheduled_transaction, so the transaction-vs-scheduled distinction is left to the tool name alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The "Write safety" block gives clear procedural guidance: call without confirmation_token to preview, then replay the identical validated request with the short-lived token. What is missing is routing guidance against alternatives — nothing says when to delete a transaction versus correcting it with update_transaction, or how dry_run relates to the token preview path.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.