delete_scheduled_transaction
Remove scheduled transactions from your YNAB budget to cancel recurring payments or prevent future automated transactions from occurring.
Instructions
Delete a scheduled transaction.
Args:
budget_id: The ID of the budget (use 'last-used' for default budget)
scheduled_transaction_id: The ID of the scheduled transaction to delete
Returns:
JSON string with confirmation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | Yes | ||
| scheduled_transaction_id | Yes |
Implementation Reference
- src/ynab_mcp/server.py:401-414 (handler)MCP tool handler function decorated with @mcp.tool(). Delegates to YNABClient.delete_scheduled_transaction and returns JSON response.@mcp.tool() async def delete_scheduled_transaction(budget_id: str, scheduled_transaction_id: str) -> str: """Delete a scheduled transaction. Args: budget_id: The ID of the budget (use 'last-used' for default budget) scheduled_transaction_id: The ID of the scheduled transaction to delete Returns: JSON string with confirmation """ client = get_ynab_client() result = await client.delete_scheduled_transaction(budget_id, scheduled_transaction_id) return json.dumps(result, indent=2)
- YNABClient helper method that performs the actual DELETE HTTP request to the YNAB API endpoint for deleting a scheduled transaction.async def delete_scheduled_transaction( self, budget_id: str, scheduled_transaction_id: str, ) -> dict[str, Any]: """Delete a scheduled transaction. Args: budget_id: The budget ID or 'last-used' scheduled_transaction_id: The scheduled transaction ID to delete Returns: Confirmation dictionary """ try: url = f"{self.api_base_url}/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}" result = await self._make_request_with_retry("delete", url) return { "scheduled_transaction": result["data"]["scheduled_transaction"], "deleted": True, } except Exception as e: raise Exception(f"Failed to delete scheduled transaction: {e}") from e